local.night.shade: Generates local 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
local.night.shade(x, shadow.start = "20:00:00", shadow.end = "06:00:00",
  localTZ, 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

localTZ

a dataframe containing the local time zone by participant during the days worked.

tz

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)
# Selecting the date/time arrival to Amsterdam for subject_ID 1
start_date <- act[act$subject_ID==1 & act$interval_type == "FLIGHT" &
act$comments == "SIN-AMS",]$datime_end
sel <- act[act$datime_start >= start_date & act$datime_end <= start_date + lubridate::days(10),]
localTZ <- data.frame(subject_ID = "1",
                      TZ = "Europe/Amsterdam", stringsAsFactors = FALSE)
local.night.shade(sel, shadow.start = "20:00:00",
                  shadow.end = "06:00:00", localTZ = localTZ)

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