DT: Example data for input to 'hwig'

Description Format Source Examples

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

1
2
3
4
5
# Load data.table
library(data.table)

# Read example data
DT <- fread(system.file("extdata", "DT.csv", package = "hwig"))

hwig documentation built on Sept. 30, 2021, 5:08 p.m.

Related to DT in hwig...