From 14558fd19a5912929b9c88398e6cd6e2bc460305 Mon Sep 17 00:00:00 2001 From: yun Date: Wed, 11 Sep 2024 21:52:02 +0800 Subject: [PATCH] fix `:=` not work when reading from file --- R/standardize.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/standardize.R b/R/standardize.R index 3b94318..ca4b714 100644 --- a/R/standardize.R +++ b/R/standardize.R @@ -32,7 +32,7 @@ methods::setMethod("faers_standardize", "FAERSascii", function(object, meddra_pa # https://stackoverflow.com/questions/70181149/is-a-saved-and-loaded-data-table-with-qs-a-correct-data-table # fix error: when load a saved FAERS object, don't change by reference cli::cli_alert("standardize {.field Preferred Term} in indi") - object@data$indi <- dt_shallow(object@data$indi) + object@data$indi <- data.table::as.data.table(object@data$indi) meddra_cols <- c("meddra_hierarchy_idx", "meddra_hierarchy_from", "meddra_code", "meddra_pt") object@data$indi[, (meddra_cols) := meddra_standardize_pt( @@ -41,7 +41,7 @@ methods::setMethod("faers_standardize", "FAERSascii", function(object, meddra_pa )] cli::cli_alert("standardize {.field Preferred Term} in reac") - object@data$reac <- dt_shallow(object@data$reac) + object@data$reac <- data.table::as.data.table(object@data$reac) object@data$reac[, (meddra_cols) := meddra_standardize_pt( clean_reac_pt(pt, meddra_data@hierarchy), # nolint meddra_data@hierarchy