From 4c1da752708ab4d93c98956558b86f894cdbd5a4 Mon Sep 17 00:00:00 2001 From: schochastics Date: Sat, 11 May 2024 22:26:40 +0200 Subject: [PATCH] fixed #101 --- DESCRIPTION | 2 +- NEWS.md | 4 ++++ R/wt_dt.R | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 17f9732..0b271c7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: webtrackR Title: Preprocessing and Analyzing Web Tracking Data -Version: 0.3.1 +Version: 0.3.1.9000 Authors@R: c( person("David", "Schoch", email = "david@schochastics.net", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-2952-4812")), diff --git a/NEWS.md b/NEWS.md index caf665b..d1e7af0 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# webtrackR 0.3.1.9000 + +* fixed undesired copy of data.table objects #101 + # webtrackR 0.3.1 * fixed CRAN problems with tests diff --git a/R/wt_dt.R b/R/wt_dt.R index 603bbe7..ed09e0f 100644 --- a/R/wt_dt.R +++ b/R/wt_dt.R @@ -44,7 +44,8 @@ as.wt_dt <- function(x, timestamp_format = "%Y-%m-%d %H:%M:%OS", tz = "UTC", x[, varnames[["timestamp"]] := as.POSIXct(get(varnames[["timestamp"]]), format = timestamp_format)] data.table::setnames(x, unname(varnames), names(varnames)) data.table::setorder(x, panelist_id, timestamp) - class(x) <- c("wt_dt", class(x)) + # class(x) <- c("wt_dt", class(x)) + data.table::setattr(x, "class", c("wt_dt", class(x))) x }