Learn R Programming

ActisoftR (version 0.0.2)

home.night.shade: Generates home night time periods

Description

This function is used by the Darwent plot

Usage

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

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab