DT {hwig} | R Documentation |
Example data for input to 'hwig'
Description
Example data for input to 'hwig'
Format
A data.table with 14297 rows and 3 variables:
- ID
individual identifier
- year
integer representing the year
Source
# Load packages library(spatsoc) library(data.table)
# Read example data DT <- fread(system.file("extdata", "DT.csv", package = "spatsoc"))
# Cast the character column to POSIXct DT[, datetime := as.POSIXct(datetime, tz = 'UTC')]
# Temporal grouping group_times(DT, datetime = 'datetime', threshold = '20 minutes')
# Spatial grouping with timegroup group_pts( DT, threshold = 5, id = 'ID', coords = c('X', 'Y'), timegroup = 'timegroup' )
fwrite(DT[, .(id = ID, group, yr = year(datetime))], 'inst/extdata/DT.csv')
Examples
# Load data.table
library(data.table)
# Read example data
DT <- fread(system.file("extdata", "DT.csv", package = "hwig"))
[Package hwig version 0.0.2 Index]