Closed Mia-data closed 11 months ago
Thank you for the report. It's a bug and I have found the root couse of this. We need to fix and release. Until this time please use the workaround of artificial "id" column that is a dataset key:
iris2 <- iris %>%
mutate(
grp_slength = cut(Sepal.Length, breaks = c(0, 5, 8, Inf)),
grp_swidth = cut(Sepal.Width, breaks = c(0, 1, 2, 3, 4, Inf)),
petal_color = as.factor(rep(c("orange", "blue", "magenta"), 50)),
id = row_number()
)
(...)
app <- init(
data = teal_data(
dataset("iris2", iris2, key = "id")
),
(...)
The issue is here:
Reprex example:
ANL <- iris[, c("Sepal.Length", "Species")]
categorical_var <- "Species"
teal::validate_has_data(ANL[, names(ANL) != categorical_var])
r$> ANL <- iris[, c("Sepal.Length", "Species")]
categorical_var <- "Species"
teal::validate_has_data(ANL[, names(ANL) != categorical_var])
Error: No data left.
Fix proposal:
drop = FALSE
to the [.data.frame
function call to avoid conversion to vector. This is potentially in other places as well.teal::validate_has_data
What is your question?
Hi,
In the "tm_outliers" module I'm not able to add "categorical_var" parameter, because if I do there is an error in the app "no data loaded". I looked at the example https://insightsengineering.github.io/teal.modules.general/latest-tag/articles/usingoutliers-module.html but it does not help to understand an issue. Could you advise what is wrong? Below a reproducible example using iris data
Code of Conduct
Contribution Guidelines
Security Policy