read.dendrometer: Reading dendrometer data

View source: R/read.dendrometer.R

read.dendrometerR Documentation

Reading dendrometer data

Description

Reads dendrometer data from .csv, .txt, .tsv, or .xlsx files, automatically parsing the datetime information and converting it to %Y-%m-%d %H:%M:%S in the requested timezone.

Supports:

  • automatic delimiter detection for text files,

  • real decimal-mark auto-detection for text files,

  • Excel serial date support (1900 / 1904 systems),

  • separate date_col + time_col,

  • optional import report output,

  • optional time-resolution diagnostics.

Usage

read.dendrometer(
  file,
  sep = NULL,
  dec = NULL,
  datetime_col = 1,
  date_col = NULL,
  time_col = NULL,
  tz = "UTC",
  sheet = NULL,
  range = NULL,
  na = c("", "NA", "NaN", "nan", "null", "NULL", "-9999"),
  assume_midnight = TRUE,
  orders = NULL,
  excel_dates = c("auto", "none", "1900", "1904"),
  drop_dup_times = TRUE,
  detect_resolution = FALSE,
  return_report = FALSE,
  quiet = TRUE
)

Arguments

file

Path to file (.csv, .txt, .tsv, .xlsx).

sep

Optional delimiter for text files. If NULL, auto-detect among comma, semicolon, tab, and pipe.

dec

Optional decimal mark for text files. If NULL, auto-detect between "." and ",".

datetime_col

Integer or name of the datetime column (default 1). Ignored if date_col is provided.

date_col

Optional integer or name of a date column.

time_col

Optional integer or name of a time column. Used together with date_col. If NULL, only the date column is parsed and "00:00:00" can be appended if assume_midnight = TRUE.

tz

Time zone for parsed datetimes (default "UTC").

sheet

Excel sheet name or index (for .xlsx; default NULL = first sheet).

range

Excel cell range (optional).

na

Character vector of strings to treat as NA.

assume_midnight

Logical; if TRUE, rows with only a date get "00:00:00".

orders

Optional vector of lubridate orders to try. If NULL, a comprehensive default set is used.

excel_dates

Character. One of "auto", "none", "1900", or "1904". Controls handling of numeric Excel serial dates.

drop_dup_times

Logical; if TRUE, drop duplicated timestamps (keep first) with a warning/message.

detect_resolution

Logical; if TRUE, compute basic time-resolution diagnostics.

return_report

Logical; if TRUE, return a list with $data and $report. If FALSE, return the tibble only. In both cases, the report is attached as attr(x, "import_report").

quiet

Logical; if TRUE, suppress informational messages.

Value

If return_report = FALSE, a tibble with a POSIXct first column and the remaining data columns unchanged.

If return_report = TRUE, a list with:

$data

The imported tibble.

$report

A structured import report.


dendRoAnalyst documentation built on May 20, 2026, 5:07 p.m.