Description Usage Arguments Details Value Author(s) See Also Examples
This function returns the part of day from time stamps. The day can be split into parts of different length with a chosen start time for the splits.
1 |
time |
Timestamp vector in POSIXct format |
nsplit |
Number of splits. |
start |
Start time of the split in hours (1-24) |
It is often useful to observe the amount of behaviors during different part of day e.g. if we want to find out how different behaviours are distributed over the entire day. This function returns the part of day from time stamps. The function returns only even hours, if nsplit provides intervals with decimal hours they will be rounded to nearest integer.
A factor with the part of day for input timestamps with hour intervals as labels-
Matti Pastell <matti.pastell@helsinki.fi>
1 2 3 4 5 6 7 8 9 10 11 12 | #Look at the daily distribution of feed intake of cows
#in dataset RIC
data(RIC)
data <- clean.RIC(RIC)
#With default split
data$period <- partOfDay(data$begin)
#Plot the results
boxplot(intake~period,data=data,ylab='Feed intake (kg)',
xlab='Time of day',main='Default settings: start =1, nsplit=4')
#A different split with directly plotting the result
boxplot(intake~partOfDay(begin,nsplit=6,start=3),data=data,
ylab='Feed intake (kg)',xlab='Time of day',main='start=3,nsplit=6')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.