home.night.shade: Generates home night time periods

Description Usage Arguments Value Examples

View source: R/night.shade.r

Description

This function is used by the Darwent plot

Usage

1
2
home.night.shade(x, shadow.start = "20:00:00", shadow.end = "06:00:00",
  homeTZ, tz = "UTC", ...)

Arguments

x

a dataframe

shadow.start

starting time of the home night, 22:00:00 by defaults

shadow.end

ending time of the home night, 08:00:00 by defaults

homeTZ

participant's home time zone. A data frame containing for each participant corresponding home time zone.

tz

is the time zone

...

Optional parameters

Value

a dataframe

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
library("dplyr")
library("lubridate")
data(act)
dat <- act %>% group_by(subject_ID) %>%
mutate(start = min(datime_start)) %>%
ungroup %>% filter(datime_start <= start + lubridate::days(5),
subject_ID == 1, interval_type != "ACTIVE")
homeTZ = data.frame(subject_ID = "1",
TZ = "Pacific/Auckland", stringsAsFactors = FALSE)
home.night.shade(dat, shadow.start = "20:00:00", shadow.end = "06:00:00",
homeTZ = homeTZ)

ActisoftR documentation built on Oct. 16, 2018, 5:04 p.m.