-
-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check on dev-versions #470
Conversation
Before the packageVersion("report")
#> [1] '0.5.9.1'
packageVersion("datawizard")
#> [1] '0.13.0'
iris$grp <- sample(letters[1:3], nrow(iris), TRUE)
x <- report::report_sample(
iris,
by = c("Species", "grp"),
select = c("Sepal.Length", "Sepal.Width")
) Created on 2024-12-09 with reprex v2.1.1 After the packageVersion("report")
#> [1] '0.5.9.1'
packageVersion("datawizard")
#> [1] '0.13.0.17'
iris$grp <- sample(letters[1:3], nrow(iris), TRUE)
x <- report::report_sample(
iris,
by = c("Species", "grp"),
select = c("Sepal.Length", "Sepal.Width")
)
#> Error: Following variable(s) were not found: setosa.c
#> Possibly misspelled? Created on 2024-12-09 with reprex v2.1.1 |
The error comes from data <- iris
data$grp <- sample(letters[1:3], nrow(data), TRUE)
by = c("Species", "grp")
select = c("Sepal.Length", "Sepal.Width")
centrality = "mean"
ci = NULL
ci_method = "wilson"
ci_correct = FALSE
weights = NULL
digits = 2
n = FALSE
variables <- colnames(data)
variables <- intersect(select, variables)
class(data) <- "data.frame"
# character to factor
data[] <- lapply(data, function(i) {
if (is.character(i)) {
i <- as.factor(i)
}
i
})
groups <- as.data.frame(lapply(data[by], factor))
result <- lapply(split(data[variables], groups), function(x) {
x[by] <- NULL
report:::.generate_descriptive_table(
x,
centrality,
weights,
digits,
n,
ci,
ci_method,
ci_correct
)
})
old_names <- datawizard::data_unite(
unique(groups),
new_column = ".old_names",
separator = "."
)[[".old_names"]]
new_names <- datawizard::data_unite(
unique(groups),
new_column = ".new_names",
separator = ", "
)[[".new_names"]]
old_names
#> [1] "setosa.a" "setosa.c" "setosa.b" "versicolor.b" "versicolor.c"
#> [6] "versicolor.a" "virginica.b" "virginica.a" "virginica.c"
new_names
#> [1] "setosa, a" "setosa, c" "setosa, b" "versicolor, b"
#> [5] "versicolor, c" "versicolor, a" "virginica, b" "virginica, a"
#> [9] "virginica, c"
result <- datawizard::data_rename(result, select = old_names, replacement = new_names)
#> Error: Following variable(s) were not found: setosa.a
#> Possibly misspelled?
names(result)[1]
#> [1] "setosa.a" Created on 2024-12-09 with reprex v2.1.1 |
The reason seems to be that |
Devel version of parameters '0.24.0'packageVersion("parameters")
#> [1] '0.24.0'
df <- lme4::sleepstudy
set.seed(123)
df$mygrp <- sample.int(5, size = 180, replace = TRUE)
df$mysubgrp <- NA
for (i in 1:5) {
filter_group <- df$mygrp == i
df$mysubgrp[filter_group] <-
sample.int(30, size = sum(filter_group), replace = TRUE)
}
set.seed(123)
m1 <- lme4::lmer(Reaction ~ Days + (1 + Days | Subject), data = df)
x <- report::report(m1) Created on 2024-12-12 with reprex v2.1.1 parameters '0.24.0.3'packageVersion("parameters")
#> [1] '0.24.0.3'
df <- lme4::sleepstudy
set.seed(123)
df$mygrp <- sample.int(5, size = 180, replace = TRUE)
df$mysubgrp <- NA
for (i in 1:5) {
filter_group <- df$mygrp == i
df$mysubgrp[filter_group] <-
sample.int(30, size = sum(filter_group), replace = TRUE)
}
set.seed(123)
m1 <- lme4::lmer(Reaction ~ Days + (1 + Days | Subject), data = df)
report::report(m1)
#> There are more names in `pattern` than in `replacement`. The last 4
#> names of `pattern` are not modified.
#> Error in UseMethod("interpret"): no applicable method for 'interpret' applied to an object of class "character"
# The error comes from `report_parameters()`
report::report_parameters(m1, include_intercept = FALSE)
#> There are more names in `pattern` than in `replacement`. The last 4
#> names of `pattern` are not modified.
#> Error in UseMethod("interpret"): no applicable method for 'interpret' applied to an object of class "character" Created on 2024-12-12 with reprex v2.1.1 |
For some reason the failing tests fail to detect the DESCRIPTION file |
No description provided.