read_CIE_csv | R Documentation |
Reads a CSV spectral data file and its companion JSON file with metadata as published by International Commission on Illumination (CIE) and then imports wavelengths and spectral values into one the classes for spectral data defined in package 'photobiology.
read_CIE_csv(file.name, label = NULL, simplify = FALSE)
file.name |
character string |
label |
character string, but if |
simplify |
logical If |
The CSV file contains only numbers encoded as character strings, and the
JSON file contains extensive metadata. The type of spectral data is encoded
as part of the file name. If the original file name of the CSV file is passed
as argument to parameter file
, the function can retrieve all data and
metadata, enough to return an R object of the correct class. The JSON file
must be located in the same folder.
Depending on the contents of the file, a source_spct
object, a
response_spct
object, or a chroma_spct
object, containing
both data and metadata.
file.name <-
system.file("extdata", "CIE_illum_C.csv",
package = "photobiologyInOut", mustWork = TRUE)
CIE_illum_C.spct <- read_CIE_csv(file.name)
CIE_illum_C.spct
file.name <-
system.file("extdata", "CIE_sle_photopic.csv",
package = "photobiologyInOut", mustWork = TRUE)
CIE_sle_photopic.spct <- read_CIE_csv(file.name)
CIE_sle_photopic.spct
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.