read_spectrapen_csv {photobiologyInOut}R Documentation

Read '.CSV' File Saved by PSI's Software.

Description

Reads and parses the header of a processed .CSV file as output by the by the PSI (Photon Systems Instruments, Czech Republic) SpectraPen miniature spectrometer.

Usage

read_spectrapen_csv(
  file,
  start.row = 1,
  date = NULL,
  geocode = NULL,
  label = NULL,
  tz = NULL,
  locale = readr::default_locale()
)

Arguments

file

character string.

start.row

integer The first line to read, counting from the top of the file.

date

a POSIXct object to use to set the "when.measured" attribute. If NULL, the default, the date is extracted from the file header.

geocode

A data frame with columns lon and lat used to set attribute "where.measured". If NULL, the default, the location is extracted from the file header.

label

character string, but if NULL the label from file header is used, if the label is missing, the index is used, and if NA the "what.measured" attribute is not set.

tz

character Time zone used for interpreting times saved in the file header.

locale

The locale controls defaults that vary from place to place. The default locale is US-centric (like R), but you can use locale to create your own locale that controls things like the default time zone, encoding, decimal mark, big mark, and day/month names.

Value

A source_mspct object.

References

https://psi.cz/

Examples

 # fetch path to example file to read
 file.name <-
   system.file("extdata", "spectrum-psi-spectrapen-SP.csv",
               package = "photobiologyInOut", mustWork = TRUE)

 spectrapen.mspct <- read_spectrapen_csv(file = file.name)

 spectrapen.mspct
 getWhenMeasured(spectrapen.mspct)
 getWhatMeasured(spectrapen.mspct)
 cat(comment(spectrapen.mspct))


[Package photobiologyInOut version 0.4.27 Index]