From 52bbb4a59b9e2810d2dc572f34aee8d17bdf860b Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Thu, 22 Feb 2024 06:09:16 +0900 Subject: [PATCH] Save concatenator --- R/textmodel.R | 1 + tests/testthat/test-textmodel.R | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/R/textmodel.R b/R/textmodel.R index 4846f89..5a62762 100644 --- a/R/textmodel.R +++ b/R/textmodel.R @@ -125,6 +125,7 @@ textmodel_newsmap.dfm <- function(x, y, label = c("all", "max"), smooth = 1.0, d data = x, weight = NULL, feature = colnames(model), + concatenator = meta(x, field = "concatenator", type = "object"), call = match.call(sys.function(-1), call = sys.call(-1)), version = utils::packageVersion("newsmap")) if (entropy != "none") diff --git a/tests/testthat/test-textmodel.R b/tests/testthat/test-textmodel.R index 27f61d6..be7881c 100644 --- a/tests/testthat/test-textmodel.R +++ b/tests/testthat/test-textmodel.R @@ -71,7 +71,8 @@ test_that("methods for textmodel_newsmap works correctly", { expect_equal( names(map), - c("model", "entropy", "data", "weight", "feature", "call", "version") + c("model", "entropy", "data", "weight", "feature", + "concatenator", "call", "version") ) # class association is calculated correctly