View source: R/transformations.R
activity | R Documentation |
Calculate activity status (active vs. inactive) at a resolution of res
from presence()
data.
activity( p, res = 15, by_logger = FALSE, missing = NULL, sun = TRUE, keep_all = FALSE, pass = TRUE, f )
p |
Dataframe. A |
res |
Numeric. The resolution over which to calculate activity in minutes. |
by_logger |
Logical. Should the activity be calculated overall, or individually for each logger visited? If there is only one logger, by_logger will automatically revert to TRUE to enable passing of logger-related variables. |
missing |
Data frame. (NOT AVAILABLE) If there are known times for a particular logger for which activity can't be recorded (i.e. times during which a logger was inactive). |
sun |
Logical. Calculate sun rise/set? If by_logger = FALSE, returns median sun rise/set across all loggers for each day. |
keep_all |
Logical. Keep all individuals, even ones with less than 24hrs of data. |
pass |
Logical. Pass 'extra' columns through the function and append them to the output. |
f |
Depreciated. Use |
A message will alert you to when the res
is larger than the 50\
the presence bout lengths. This may result in missed activity, and it may be
better to choose a smaller res
.
The missing
data frame should have columns start
and end
corresponding to the start and end times of the missing data. Any activity between
those start/end times will be scored as unknown, regardless of the
logger_id
. However, if by_logger
is TRUE, missing
may
also include the column logger_id
. In this case, only activity for the
logger with the missing start/end times will be scored as unknown. If
by_logger
is TRUE but missing
does not contain the column
logger_id
, all activity between the start and end times will be scored
as unknown, regardless of the logger. See examples.
v <- visits(chickadees) p <- presence(v) a <- activity(p, res = 1) # By logger (may take a while) ## Not run: a <- activity(p, res = 1, by_logger = TRUE) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.