View source: R/states2prop_time_active.R
states2prop_time_active | R Documentation |
states2prop_time_active
calculates the proportion of time in state
active for each animal_tag and day.
states2prop_time_active(active_states, activity_gaps, gps = NULL,
pos = NULL, dayshift = "sunrise", dawn_degree = 12,
period = "day", max_na = 0)
active_states |
A data.table with the predicted active states (return
of function |
activity_gaps |
A data.table with the identified gaps in the activity
data (return of function |
gps |
A data.table with the GPS positions (at least one) of the animals. The table should contain the columns: <animal_tag>, <longitude>, <latitude>. |
pos |
A vector containing longitude and latitude of the research area. This parameter is only necessary when no GPS-positions are provided or when the GPS-positions for some animals are missing. |
dayshift |
Either "sunrise" or "dawn". Defines when consecutive days are separated so that each day contains one complete night and one complete day. The identifier for each day is called <date_se> for sunrise and <date_dawn> for dawn. |
dawn_degree |
An integer between 0 and 90 that defines the angle of the sun below the horizon at dawn and dusk. |
period |
Either "day" or "week", specifies the period of time in which the proportion of time in state active is aggregated. |
max_na |
An integer with the maximum number of minutes with NA that are allowed for each period. When this threshold is crossed proportion of time in state active will be set to NA for this period. |
A data.table with the proportion of time in state active for each animal_tag and day. The proportion of time in state active is returned for the whole day <total>, during daytime <day> (sunrise till sunset), during nighttime <night> (dusk till dawn), during dusk <dusk> (sunset till the sun reaches dawn_degree),during dawn <dawn> ()
states2prop_time_active(active_states = active_states_a,
activity_gaps = activity_data_gaps,
gps = gps_data,
dayshift = "sunrise",
dawn_degree = 12,
period = "day"
max_na = 30)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.