% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/io_read1d.R
\name{read1d}
\alias{read1d}
\alias{read1d_proc}
\title{Import 1D NMR spectra (TopSpin processed)}
\usage{
read1d(
  path,
  exp_type = list(pulprog = "noesygppr1d"),
  n_max = 1000,
  filter = TRUE,
  recursive = TRUE,
  verbose = 1,
  to_global = FALSE
)

read1d_proc(
  path,
  exp_type = list(pulprog = "noesygppr1d"),
  n_max = 1000,
  filter = TRUE,
  recursive = TRUE,
  verbose = 1,
  to_global = FALSE
)
}
\arguments{
\item{path}{Character. Directory path containing Bruker NMR experiments.}

\item{exp_type}{Named list. Optional filtering specification based on
acquisition or processing metadata. Each list element must correspond to a
metadata field (e.g. \code{pulprog}, \code{ns}, \code{rg}). Filtering supports:
\itemize{
\item Exact match: \code{list(pulprog = "noesygppr1d")}
\item Membership: \code{list(pulprog = c("zg30", "noesygppr1d"))}
\item Numeric range: \code{list(ns = list(range = c(16, 128)))}
\item Generic comparison: \code{list(ns = list(op = ">=", value = 32))}
}
Multiple fields are combined using logical AND.}

\item{n_max}{Integer. Maximum number of spectra to import. Default: 1000.}

\item{filter}{Logical. Filter out experiments with incomplete file systems.}

\item{recursive}{Logical. Search \code{path} recursively. Default: TRUE.}

\item{verbose}{Logical or numeric. Verbosity level.}

\item{to_global}{Logical. If \code{TRUE}, the returned objects are additionally
assigned to the global environment.}
}
\value{
A named list with three elements:
\describe{
\item{X}{A numeric matrix of spectra (rows = samples, columns = ppm values).}
\item{ppm}{A numeric vector of chemical shift values (ppm).}
\item{meta}{A data frame of acquisition and processing metadata,
row-aligned with \code{X}.}
}

If \code{to_global = TRUE}, objects with the same names in the global
environment will be overwritten.
}
\description{
Imports TopSpin-processed 1D NMR spectra together with spectrometer acquisition
and TopSpin processing parameters (\code{acqus} and \code{procs}, respectively).
}
\examples{
path <- system.file("extdata", package = "metabom8")

read1d_proc(path, exp_type = list(pulprog = "noesygppr1d"), n_max = 2)

}
