plot_activity: Plot activity values

Description Usage Arguments Examples

View source: R/plot_agd.R

Description

Plot a time series of activity values (by default, the counts on the vertical axis axis1).

Usage

1
plot_activity(agdb, var, color = "black", nrow = NULL, ncol = NULL)

Arguments

agdb

A tibble (tbl) of activity data (at least) an epochlength attribute.

var

The activity variable (unquoted) to plot on the y-axis.

color

Activity line color.

nrow, ncol

Number of rows and columns. Relevant only if the activity data is grouped.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data("gtxplus1day")
sub_gt3x <- gtxplus1day %>%
  dplyr::filter(timestamp <= lubridate::as_datetime("2012-06-27 18:00:00"))

data <- sub_gt3x %>%
  collapse_epochs(60) %>%
  apply_cole_kripke()

plot_activity(data, axis1, color = "gray")
plot_activity(data, axis1, color = "sleep")

oslerinhealth/actigraph.sleepr documentation built on May 25, 2021, 1:06 p.m.