diff --git a/CRAN-SUBMISSION b/CRAN-SUBMISSION index c666c79a8..8c4a37b42 100644 --- a/CRAN-SUBMISSION +++ b/CRAN-SUBMISSION @@ -1,3 +1,3 @@ -Version: 0.18.8 -Date: 2022-11-22 19:08:48 UTC -SHA: 005c7d2dbad8833ed8b56541e8417637c3228b81 +Version: 0.19.0 +Date: 2023-01-30 08:26:46 UTC +SHA: 3cce4c54135598d8559cb272e191ad96b35938e8 diff --git a/DESCRIPTION b/DESCRIPTION index 440ca52e1..ab055cf4a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: insight Title: Easy Access to Model Information for Various Model Objects -Version: 0.18.8.14 +Version: 0.19.0 Authors@R: c(person(given = "Daniel", family = "Lüdecke", diff --git a/R/utils_get_data.R b/R/utils_get_data.R index 5be6e9dd1..6c1406f5f 100644 --- a/R/utils_get_data.R +++ b/R/utils_get_data.R @@ -67,7 +67,7 @@ # detect matrix columns ---------------------------------------------------- # check if we have any matrix columns, e.g. from splines - mc <- sapply(mf, is.matrix) + mc <- vapply(mf, is.matrix, TRUE) # save original response value and the respective single variable names of # the response for later. we don't want to change the response value, @@ -223,15 +223,15 @@ mf <- stats::na.omit(mf) # then set back attributes - mf <- as.data.frame(mapply(function(.d, .l) { + mf <- as.data.frame(Map(function(.d, .l) { attr(.d, "labels") <- .l .d - }, mf, value_labels, SIMPLIFY = FALSE), stringsAsFactors = FALSE) + }, mf, value_labels), stringsAsFactors = FALSE) - mf <- as.data.frame(mapply(function(.d, .l) { + mf <- as.data.frame(Map(function(.d, .l) { attr(.d, "label") <- .l .d - }, mf, variable_labels, SIMPLIFY = FALSE), stringsAsFactors = FALSE) + }, mf, variable_labels), stringsAsFactors = FALSE) } } @@ -458,8 +458,16 @@ } else { for (i in seq_along(interactions)) { int <- interactions[i] - mf[[names(int)]] <- as.factor(substr(as.character(mf[[int]]), regexpr("\\.[^\\.]*$", as.character(mf[[int]])) + 1, nchar(as.character(mf[[int]])))) - mf[[int]] <- as.factor(substr(as.character(mf[[int]]), 0, regexpr("\\.[^\\.]*$", as.character(mf[[int]])) - 1)) + mf[[names(int)]] <- as.factor(substr( + as.character(mf[[int]]), + regexpr("\\.[^\\.]*$", as.character(mf[[int]])) + 1, + nchar(as.character(mf[[int]])) + )) + mf[[int]] <- as.factor(substr( + as.character(mf[[int]]), + 0, + regexpr("\\.[^\\.]*$", as.character(mf[[int]])) - 1 + )) } if (isTRUE(verbose)) { format_warning( @@ -600,7 +608,7 @@ if (length(still_missing) && isTRUE(verbose)) { format_warning( - sprintf("Following potential variables could not be found in the data: %s", paste0(still_missing, collapse = " ,")) + sprintf("Following potential variables could not be found in the data: %s", toString(still_missing)) ) } diff --git a/cran-comments.md b/cran-comments.md index 8aca12ebf..9d9665f8f 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1 +1,8 @@ -This submission fixes issues with reverse-dependencies from a planned update of the *performance* package. The update of the *performance* package introduces breaking changes, which are anticipated in the fixes included in this release. \ No newline at end of file +## revdepcheck results + +We checked 33 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package. + + * We saw 1 new problem + * We failed to check 0 packages + +We saw one error (failing example) for the *marginaleffects* package. This is expected, the maintainer is informed and has prepared an update of *marginaleffects*, which can be submitted once *insight* is accepted on CRAN. diff --git a/tests/testthat/test-gam.R b/tests/testthat/test-gam.R index 3e3444bac..a91b443d7 100644 --- a/tests/testthat/test-gam.R +++ b/tests/testthat/test-gam.R @@ -364,5 +364,4 @@ if (.runThisTest && requiet("mgcv") && requiet("httr")) { p2 <- predict(mod, type = "response") expect_equal(as.vector(p1), p2, ignore_attr = TRUE) }) - }