attempt_limits | R Documentation |
attempt_limits
Determines the start and end dates of the potential
nesting attempt based on the patterns of revisitation of the candidate nest.
attempt_limits(x, min_consec, nest_cycle)
x |
|
min_consec |
Integer. Minimum number of consecutive days a location needs to be visited to be considered as a candidate nest. See Details |
nest_cycle |
Integer. Duration (in days) of a complete nesting cycle |
Used with lapply
inside function revisit_stats
.
The function uses a moving window of size nest_cycle
to find the
most likely time range of the nesting attempt.
Attendance is expected to be maximum during the initial phase of nesting,
so we assume that the longest series of consecutive days corresponds to
the beginnig of the nesting attempt. Therefore, the moving window starts
at the beginning of the first series of consecutive days longer than
min_consec
. This helps discard any early visits to the nest before
the actual start of the attempt.
After that, the function slides a moving window of size nest_cycle
to the data until it hits the last visit. The window that encompasses the
highest number of visits is selected as most likely delimiting the nesting
attempt.
If the last nest visit is on the end date of the window or later,
the end of the attempt is set at the end date of the window (which is
the start date + nest_cycle
). This helps discard any later visits to
the nest after the attempt is already concluded.
If the last nest visit is earlier than the ending date of the window, the end of the attempt is set at the date of the last visit.
Returns data.frame
with start and end dates of the
attempt and number of nest visits within it.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.