From 92ca9c6d28015f7bcf1076d17e053022da99cd16 Mon Sep 17 00:00:00 2001 From: "Alec L. Robitaille" Date: Fri, 1 Nov 2024 11:34:08 -0300 Subject: [PATCH] fix reduce example runtime --- R/direction_to_leader.R | 3 +++ R/distance_to_leader.R | 3 +++ R/leader_direction_group.R | 3 +++ man/direction_to_leader.Rd | 3 +++ man/distance_to_leader.Rd | 3 +++ man/leader_direction_group.Rd | 3 +++ 6 files changed, 18 insertions(+) diff --git a/R/direction_to_leader.R b/R/direction_to_leader.R index a9e1e89b..37431ff0 100644 --- a/R/direction_to_leader.R +++ b/R/direction_to_leader.R @@ -46,6 +46,9 @@ #' # Read example data #' DT <- fread(system.file("extdata", "DT.csv", package = "spatsoc")) #' +#' # (Subset example data to reduce example run time) +#' DT <- DT[year(datetime) == 2016] +#' #' # Cast the character column to POSIXct #' DT[, datetime := as.POSIXct(datetime, tz = 'UTC')] #' diff --git a/R/distance_to_leader.R b/R/distance_to_leader.R index 78795526..6bbab8dd 100644 --- a/R/distance_to_leader.R +++ b/R/distance_to_leader.R @@ -52,6 +52,9 @@ #' # Cast the character column to POSIXct #' DT[, datetime := as.POSIXct(datetime, tz = 'UTC')] #' +#' # (Subset example data to reduce example run time) +#' DT <- DT[year(datetime) == 2016] +#' #' # Temporal grouping #' group_times(DT, datetime = 'datetime', threshold = '20 minutes') #' diff --git a/R/leader_direction_group.R b/R/leader_direction_group.R index 2a4dba9b..074df0db 100644 --- a/R/leader_direction_group.R +++ b/R/leader_direction_group.R @@ -65,6 +65,9 @@ #' # Read example data #' DT <- fread(system.file("extdata", "DT.csv", package = "spatsoc")) #' +#' # (Subset example data to reduce example run time) +#' DT <- DT[year(datetime) == 2016] +#' #' # Cast the character column to POSIXct #' DT[, datetime := as.POSIXct(datetime, tz = 'UTC')] #' diff --git a/man/direction_to_leader.Rd b/man/direction_to_leader.Rd index 48c107c4..b200361f 100644 --- a/man/direction_to_leader.Rd +++ b/man/direction_to_leader.Rd @@ -54,6 +54,9 @@ library(data.table) # Read example data DT <- fread(system.file("extdata", "DT.csv", package = "spatsoc")) +# (Subset example data to reduce example run time) +DT <- DT[year(datetime) == 2016] + # Cast the character column to POSIXct DT[, datetime := as.POSIXct(datetime, tz = 'UTC')] diff --git a/man/distance_to_leader.Rd b/man/distance_to_leader.Rd index 049e4e9d..ce7d5b05 100644 --- a/man/distance_to_leader.Rd +++ b/man/distance_to_leader.Rd @@ -57,6 +57,9 @@ DT <- fread(system.file("extdata", "DT.csv", package = "spatsoc")) # Cast the character column to POSIXct DT[, datetime := as.POSIXct(datetime, tz = 'UTC')] +# (Subset example data to reduce example run time) +DT <- DT[year(datetime) == 2016] + # Temporal grouping group_times(DT, datetime = 'datetime', threshold = '20 minutes') diff --git a/man/leader_direction_group.Rd b/man/leader_direction_group.Rd index 34e8708d..e9ee6432 100644 --- a/man/leader_direction_group.Rd +++ b/man/leader_direction_group.Rd @@ -81,6 +81,9 @@ library(data.table) # Read example data DT <- fread(system.file("extdata", "DT.csv", package = "spatsoc")) +# (Subset example data to reduce example run time) +DT <- DT[year(datetime) == 2016] + # Cast the character column to POSIXct DT[, datetime := as.POSIXct(datetime, tz = 'UTC')]