% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/climate_functions.R
\name{read.climate}
\alias{read.climate}
\title{Read and standardize climate data for dendrometer analyses}
\usage{
read.climate(
  x,
  time_col = NULL,
  vars = NULL,
  sep = NULL,
  dec = NULL,
  header = TRUE,
  sheet = 1,
  tz = "UTC",
  drop_duplicate_time = TRUE,
  min_time_success = 0.6,
  verbose = TRUE,
  datetime_col = NULL,
  date_col = NULL,
  range = NULL,
  na = c("", "NA", "NaN", "nan", "null", "NULL", "-9999", "-999", "N/A"),
  assume_midnight = TRUE,
  orders = NULL,
  excel_dates = c("auto", "none", "1900", "1904"),
  drop_empty_cols = TRUE,
  trim_names = TRUE,
  detect_resolution = FALSE,
  return_report = FALSE,
  quiet = !verbose
)
}
\arguments{
\item{x}{A data frame or path to a file. Supported file extensions are
csv, txt, tsv, tab, dat, xls, xlsx, rds, rda, and RData.}

\item{time_col}{Backward-compatible explicit time/datetime column name or index.
If date_col is also supplied, this is treated as the time-of-day column.}

\item{vars}{Optional character vector of climate variables to keep.}

\item{sep}{Optional field separator for text files. If NULL, it is auto-detected.}

\item{dec}{Optional decimal mark for text files. If NULL, it is auto-detected.}

\item{header}{Logical; passed to text-file readers.}

\item{sheet}{Sheet name or index for Excel files.}

\item{tz}{Time zone for parsed timestamps.}

\item{drop_duplicate_time}{Logical; if TRUE, duplicated timestamps are removed.}

\item{min_time_success}{Minimum parsing success proportion for automatic time detection.}

\item{verbose}{Logical; print an import summary.}

\item{datetime_col}{Optional explicit datetime column name or index. Prefer this
when the file has one combined timestamp column.}

\item{date_col}{Optional explicit date column name or index. Can be combined with
time_col, or parsed alone with midnight appended when assume_midnight = TRUE.}

\item{range}{Optional Excel cell range.}

\item{na}{Strings to treat as missing values.}

\item{assume_midnight}{Logical; if TRUE, date-only values are assigned 00:00:00.}

\item{orders}{Optional lubridate parse_date_time() orders.}

\item{excel_dates}{One of auto, none, 1900, or 1904.}

\item{drop_empty_cols}{Logical; if TRUE, columns that are completely empty are removed.}

\item{trim_names}{Logical; if TRUE, trim whitespace from column names.}

\item{detect_resolution}{Logical; if TRUE, attach simple time-resolution diagnostics.}

\item{return_report}{Logical; if TRUE, return list(data = ..., report = ...).}

\item{quiet}{Logical; suppress messages. By default this is the inverse of verbose.}
}
\value{
A tibble of class dm_clim with TIME in the first column. An import
  report is attached as attr(x, "import_report").
}
\description{
A robust climate-data reader designed to be as flexible as read.dendrometer().
It accepts data frames and common file formats, auto-detects separators and
decimal marks, parses many datetime formats, supports Excel serial dates,
supports separate date + time columns, detects the time column automatically,
sorts timestamps, removes duplicates, converts numeric-like climate variables,
and returns a standardized tibble with a POSIXct TIME column.
}
