Skip to contents

Import

Wearable light logger data can be imported from a variety of sources, i.e., exports from measurement devices or online databases. This section also includes functions to import auxiliary data, such as sleep/wake data. The family of import functions works on a variety of device-specific files through import_*().

import_Dataset() import
Import a light logger dataset or related data
import_Statechanges()
Import data that contain Datetimes of Statechanges
import_adjustment()
Adjust device imports or make your own

Insight

This section includes functions to gain more insight into the data. Functions in this section will not return a version of the input dataset, but rather information based on it.

count_difftime()
Counts the Time differences (epochs) per group (in a grouped dataset)
dominant_epoch()
Determine the dominant epoch/interval of a dataset
gapless_Datetimes()
Create a gapless sequence of Datetimes
gap_finder()
Check for and output gaps in a dataset
dst_change_summary()
Get a summary of groups where a daylight saving time change occurs.

Process

This section includes functions to process light logger data, e.g., to validate and clean data, to filter, cut or aggreagate data, or to join datasets. All of these functions will return a version of the input dataset.

gap_handler()
Fill implicit gaps in a light logger dataset
cut_Datetime()
Create Datetime bins for visualization and calculation
aggregate_Datetime()
Aggregate Datetime data
aggregate_Date()
Aggregate dates to a single day
create_Timedata()
Create a Time-of-Day column in the dataset
filter_Datetime() filter_Date()
Filter Datetimes in a dataset.
filter_Datetime_multiple()
Filter multiple times based on a list of arguments.
filter_Time()
Filter Times in a dataset.
join_datasets()
Join similar Datasets
dst_change_handler()
Handle jumps in Daylight Savings (DST) that are missing in the data

Expand

Expanding light logger data through auxiliary data and/or reference data allows for a more comprehensive analysis.

data2reference()
Create reference data from other data
sc2interval()
Statechange (sc) Timestamps to Intervals
interval2state()
Adds a state column to a dataset from interval data
sleep_int2Brown()
Recode Sleep/Wake intervals to Brown state intervals
Brown_check()
Check whether a value is within the recommended illuminance/MEDI levels by Brown et al. (2022)
Brown_rec()
Set the recommended illuminance/MEDI levels by Brown et al. (2022)
Brown2reference()
Add Brown et al. (2022) reference illuminance to a dataset

Visualize

This section includes functions to visualize light logger data, e.g., to plot light exposure or to plot sleep/wake data.

gg_overview()
Plot an overview of dataset intervals with implicit missing data
gg_day()
Create a simple Time-of-Day plot of light logger data, faceted by Date
gg_days()
Create a simple datetime plot of light logger data, faceted by group
gg_doubleplot()
Double Plots

Metrics

This section includes functions to calculate light exposure metrics.

barroso_lighting_metrics()
Circadian lighting metrics from Barroso et al. (2014)
bright_dark_period()
Brightest or darkest continuous period
centroidLE()
Centroid of light exposure
disparity_index()
Disparity index
duration_above_threshold()
Duration above/below threshold or within threshold range
exponential_moving_average()
Exponential moving average filter (EMA)
frequency_crossing_threshold()
Frequency of crossing light threshold
intradaily_variability()
Intradaily variability (IV)
interdaily_stability()
Interdaily stability (IS)
midpointCE()
Midpoint of cumulative light exposure.
nvRC()
Non-visual circadian response
nvRC_circadianDisturbance() nvRC_circadianBias() nvRC_relativeAmplitudeError()
Performance metrics for circadian response
nvRD()
Non-visual direct response
nvRD_cumulative_response()
Cumulative non-visual direct response
period_above_threshold()
Length of longest continuous period above/below threshold
pulses_above_threshold()
Pulses above threshold
threshold_for_duration()
Find threshold for given duration
timing_above_threshold()
Mean/first/last timing above/below threshold.

Helpers

This section includes helper functions that are used in the other sections.

symlog_trans()
Scale positive and negative values on a log scale
Datetime_breaks()
Create a (shifted) sequence of Datetimes for axis breaks
Datetime_limits()
Find or set sensible limits for Datetime axis

Datasets

This section includes data that are used in LightLogR and in examples.

sample.data.environment
Sample of wearable data combined with environmental data
supported_devices()
Get all the supported devices in LightLogR
ll_import_expr()
Get the import expression for a device