Description Usage Arguments Details Value Examples
View source: R/wf_moving_window.R
Creates a nested data.frame
from an mv_wind
object
1 | nest_windows(dat, mv_wind)
|
dat |
|
mv_wind |
|
Uses sqldf()
to join locations to windows
that they fall within. Then uses nest()
to create
a nested data.frame
holding the location data in a list column.
Returns a nested data.frame
(a tbl
) with columns:
window
– An integer indexing the window number
start
– The date and time of the window start (class POSIXct
)
end
– The date and time of the window end (class POSIXct
)
data
– A list column containing tbl
s with the animal location
data. It has columns:
t
– The location timestamp (class POSIXct
)
x
– The x-coordinate of the location
y
– The y-coordinate of the location
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Not run:
# Load lubridate
library(lubridate)
# Load data
data(tracks)
# Keep 1 individual
tk1 <- tracks[which(tracks$id == "ID01"), ]
# Construct moving windows
wind <- construct_windows(start = ymd_hms("2021-05-15 00:00:00"),
width = days(5),
step = days(2),
end = ymd_hms("2021-06-30 00:00:00"))
#Nest
nst <- nest_windows(tk1, wind)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.