acto: Plot an actogram of a target behaviour

View source: R/acto.R

actoR Documentation

Plot an actogram of a target behaviour

Description

Plots the presents or absence of one or more target behaviours in an actogram style on a daily basis

Usage

acto(data = ... , time = "..." , behaviour = "..." , target_bev = ... , daily = FALSE , night_shift = FALSE , sun = F , suncolor = "red" , timezone = "UTC" , long = ... , lat = ...)

Arguments

data

data frame containing the timestamps and the corresponding behaviour

time

column name of the timestamp in " "

the date format needs to be in year-month-day hour-month-minute

behaviour

column name of the behaviour

can be numeric, a factor or a character

target_bev

specify or or more behaviours from the behaviour column to display

for more than one behaviour this needs to be a vector(c())

daily

set to TRUE if every day should be marked on the y-axis

by default only the first day of the month is marked on the axis

night_shift

set to TRUE if the plot shall center around midnight

by default the plot centers around midday

sun

set to TRUE if sunset and sunrise lines shall be added to the plot

default is set to FALSE - see also details

suncolor

specify the color of the sunset/sunrise lines put in "..." (uses ggplot color codes)

default is red

timezone

specify the timezone in "..."

default is "UTC"

long

Longitude coordinate - needed for the calculation of the sunset/sunrise

lat

Latitude coordinate - needed for the calculation of the sunset/sunrise

Details

The sun times are calculated on a minute scale, so sunset or sunrise can happen at any minute. Often acceleration data is not recorded on a minute scale, therefore there might by sun times with no coresponding acceleration data timestamp. This would however distort the whole graph. To solve this the sun times are matched to the closest acceleration timestamp. How much the sun time is changed by this depends on how often acceleration data is sampled. If these intervals are long, the amount by which the suntimes change might also by quite big. Using the sun indicator on data sets with long intervals between acceleration samples might not work very well.

Author(s)

Wanja Rast

References

Sunlines are calculated using the maptools package

See Also

acto.odba

Examples

data("acto.data")

acto.odba(data = acto.data , time = "timestamp" , behaviour = "behaviour" , target_bev = c(1))

wanjarast/accelerateR documentation built on June 21, 2022, 3:29 p.m.