read_FReD_csv: Read '.CSV' FReD database.

View source: R/read-fred-csv.r

read_FReD_csvR Documentation

Read '.CSV' FReD database.

Description

Reads a CSV data file downloaded from the FReD (Floral Reflectance Database) and then imports wavelengths and spectral reflectance values and flower ID.

Usage

read_FReD_csv(
  file,
  date = NA,
  geocode = NULL,
  label = NULL,
  tz = NULL,
  locale = readr::default_locale()
)

Arguments

file

character string

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".

label

character string, but if NULL the value of file 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. Those relevant should match the format of the CSV file being read.

Value

A reflectance_spct object.

References

http://www.reflectance.co.uk Arnold SEJ, Faruq S, Savolainen V, McOwan PW, Chittka L, 2010 FReD: The Floral Reflectance Database - A Web Portal for Analyses of Flower Colour. PLoS ONE 5(12): e14287. doi:10.1371/journal.pone.0014287

Examples


  file.name <- 
    system.file("extdata", "FReDflowerID_157.csv", 
                package = "photobiologyInOut", mustWork = TRUE)
                
  fred.spct <- read_FReD_csv(file = file.name)
  
  fred.spct
  getWhatMeasured(fred.spct)
  cat(comment(fred.spct))
  

photobiologyInOut documentation built on Aug. 15, 2022, 9:09 a.m.