acto | R Documentation |
Plots the presents or absence of one or more target behaviours in an actogram style on a daily basis
acto(data = ... , time = "..." , behaviour = "..." , target_bev = ... , daily = FALSE , night_shift = FALSE , sun = F , suncolor = "red" , timezone = "UTC" , long = ... , lat = ...)
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 |
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.
Wanja Rast
Sunlines are calculated using the maptools package
acto.odba
data("acto.data") acto.odba(data = acto.data , time = "timestamp" , behaviour = "behaviour" , target_bev = c(1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.