proximate_read_data: Read ProxiMate (.tsv) files

View source: R/proximate_read_data.R

proximate_read_dataR Documentation

Read ProxiMate (.tsv) files

Description

\loadmathjax

This function imports .tsv files generated by BUCHI ProxiMate sensors. The text encoding of file (UTF-8 or Windows-1252/"ANSI") is automatically detected and used to correctly decode special characters (e.g. accented letters) in metadata fields such as notes or IDs.

Usage

proximate_read_data(file)

Arguments

file

A string indicating the name (and path) of the .tsv file. A textConnection (or any other R connection providing the file's content) can also be passed.

Value

A data.frame containing all the metadata, response variables and spectra in the tsv file. The spectra is returned in a matrix embedded in the data.frame which can be accessed as ...$spc.

Author(s)

Leonardo Ramirez-Lopez

Examples

data("proximateCannabis")
filename <- paste0(tempdir(), "/proximateCannabis.tsv")
# Need to produce a tsv file before we can read it
proximate_write_data(
  x = proximateCannabis,
  file = filename,
  properties = c("CBDA", "THCA", "CBD", "THC")
)
# Equivalent to dataset proximateCannabis
dat <- proximate_read_data(filename)

proximetricsR documentation built on Sept. 4, 2026, 5:08 p.m.