% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ingest_sensors.R
\name{read_generic_csv}
\alias{read_generic_csv}
\title{Read a generic sensor CSV with flexible column mapping}
\usage{
read_generic_csv(
  file,
  col_map = NULL,
  spatial_res = 4L,
  min_obs = 3L,
  categorical_cols = c("sediment_type", "benthic_communities", "biotope",
    "fishing_intensity"),
  verbose = TRUE
)
}
\arguments{
\item{file}{Character. Path to the CSV file.}

\item{col_map}{Named character vector mapping oystermapR variable names to
column names in the CSV. Only variables you want to extract need to be
listed. Example:

\if{html}{\out{<div class="sourceCode r">}}\preformatted{col_map = c(
  lat                 = "Latitude",
  lon                 = "Longitude",
  depth               = "Depth_m",
  substrate_hardness  = "Hardness",
  temperature         = "Temp_C"
)
}\if{html}{\out{</div>}}

If \code{col_map} is \code{NULL} (default), the function attempts automatic column
name matching using built-in synonym lists (case-insensitive).}

\item{spatial_res}{Integer. Decimal places for spatial binning (default \code{4}).}

\item{min_obs}{Integer. Minimum observations per cell (default \code{3}).}

\item{categorical_cols}{Character vector. Column names (after mapping) that
should be treated as categorical -- mode (most common value) is returned
instead of mean. Default: \code{c("sediment_type", "benthic_communities", "biotope", "fishing_intensity")}.}

\item{verbose}{Logical. Print a summary after loading (default \code{TRUE}).}
}
\value{
A spatially averaged dataframe using oystermapR standard column names.
}
\description{
Reads any sensor CSV (Lowrance BioBase, CTD/probe logger, bathymetric sonar,
sidescan export, etc.) and maps its columns to the standard oystermapR
variable names. Performs spatial averaging at a specified resolution.
}
\examples{
\donttest{
# Lowrance BioBase export (automatic column matching)
biobase <- read_generic_csv("biobase_export.csv")

# With explicit column mapping
probe <- read_generic_csv(
  "ctd_data.csv",
  col_map = c(lat="Lat", lon="Lon", temperature="Temp", salinity="Sal",
              dissolved_oxygen="DO_mgl")
)
}
}
