Brown2reference {LightLogR} | R Documentation |
Add Brown et al. (2022) reference illuminance to a dataset
Description
Adds several columns to a light logger dataset. It requires a column that contains the Brown states, e.g. "daytime", "evening", and "night". From that the function will add a column with the recommended illuminance, a column that checks if the illuminance of the dataset is within the recommended illuminance levels, and a column that gives a label to the reference.
Usage
Brown2reference(
dataset,
MEDI.colname = MEDI,
Brown.state.colname = State.Brown,
Brown.rec.colname = Reference,
Reference.label = "Brown et al. (2022)",
overwrite = FALSE,
...
)
Arguments
dataset |
A dataframe that contains a column with the Brown states |
MEDI.colname |
The name of the column that contains the MEDI values which are used for checks against the Brown reference illuminance. Must be part of the dataset. |
Brown.state.colname |
The name of the column that contains the Brown states. Must be part of the dataset. |
Brown.rec.colname |
The name of the column that will contain the recommended illuminance. Must not be part of the dataset, otherwise it will throw an error. |
Reference.label |
The label that will be used for the reference. Expects
a |
overwrite |
If |
... |
Additional arguments that will be passed to |
Details
On a lower level, the function uses Brown_rec()
and Brown_check()
to
create the required information.
Value
A dataframe on the basis of the dataset
that contains the added
columns.
References
https://journals.plos.org/plosbiology/article?id=10.1371/journal.pbio.3001571
See Also
Other Brown:
Brown_check()
,
Brown_rec()
,
sleep_int2Brown()
Examples
#add Brown reference illuminance to some sample data
testdata <- tibble::tibble(MEDI = c(100, 10, 1, 300),
State.Brown = c("day", "evening", "night", "day"))
Brown2reference(testdata)