View source: R/summary_table.R
| summary_table | R Documentation |
These helpers create a publication-ready summary table for light logger datasets. Users can either calculate the metrics, generate overview counts, or render the complete gt table.
This function creates a tibble that gives some high level information about a dataset: How many participants are in there, the number of participant days, how many participant days are complete above a given threshold, how much data is missing, and (if provided) what the photoperiod is.
summary_overview(
dataset,
Variable.colname = MEDI,
coordinates = NULL,
location = NULL,
site = NULL,
Datetime.colname = Datetime,
Id.colname = Id,
threshold.missing = 0.2,
programmatic.use = FALSE,
handle.gaps = TRUE
)
summary_metrics(
dataset,
Variable.colname = MEDI,
Datetime.colname = Datetime,
Id.colname = Id,
threshold.missing = 0.2,
programmatic.use = FALSE,
handle.gaps = TRUE
)
summary_table(
dataset,
coordinates = NULL,
location = NULL,
site = NULL,
color = "grey",
Variable.colname = MEDI,
Datetime.colname = Datetime,
Id.colname = Id,
threshold.missing = 0.2,
Variable.label = "melanopic EDI (lx)",
histograms = TRUE
)
dataset |
A data frame containing light logger data. |
Variable.colname |
Column containing light exposure values. Expects a
symbol; defaults to |
coordinates |
Optional numeric vector of length two containing latitude
and longitude (in that order). If supplied, photoperiod information is
calculated when the dataset does not already contain a |
location |
Optional location description (e.g. city name). |
site |
Optional site description (e.g. country or study site). |
Datetime.colname |
Column containing the timestamp information. Expects
a symbol; defaults to |
Id.colname |
Column containing the participant identifier. Expects a
symbol; defaults to |
threshold.missing |
Proportion of missing data (per participant-day) tolerated before a day is considered incomplete. |
programmatic.use |
Whether the function is used by another function.
This determines the number of columns to be output. Default is |
handle.gaps |
Whether gaps in the data should be handled. Sets the
argument in |
color |
Color used for histogram accents in the metrics section. |
Variable.label |
Label used in the table footnote to describe the light variable. |
histograms |
Logical indicating whether histogram spark lines should be added for metrics where applicable. |
The function is used within summary_table().
A tibble with overview metrics (type, name, mean, SD, min,
max, plot). A location_string attribute is attached to the result for
use in summary_table(). If programmatic.use = FALSE, type, SD and
plot are removed.
A tibble with summarized metrics across participant-days and
participant-level stability measures. Columns are compatible with
summary_table().
A gt table.
sample.data.environment |> summary_overview()
sample.data.irregular |> summary_overview()
sample.data.environment |>
filter_Date(length = "3 days") |>
summary_metrics()
#sample.data.environment |> summary_table(coordinates = c(47,9))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.