You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is not really an error but the message is missleading, the issue is that the number of levels in the variable should be >= 1 be It is actually ok if the variable is of length 0. (and there is no bug if it is a character.)
Should we be more tolerant, should we improve the error message or force the users to use factors ?
library(chevron)
#> Registered S3 method overwritten by 'tern':#> method from #> tidy.glm broom
library(dplyr)
#> #> Attaching package: 'dplyr'#> The following objects are masked from 'package:stats':#> #> filter, lag#> The following objects are masked from 'package:base':#> #> intersect, setdiff, setequal, unionproc_data<-syn_dataproc_data$addv<-proc_data$addv[NULL, ]
preprocess(pdt01) <-function(adam_db, ...) {
adam_db$addv<-adam_db$addv %>%
mutate(across(all_of(c(
"DVSCAT",
"DVTERM"
)), ~ reformat(.x, nocoding))) %>%
mutate(
DVSCAT= with_label(
.data$DVSCAT,
"Category"
),
DVTERM= with_label(
.data$DVTERM,
"Category"
)
) %>%
mutate(DVTERM=stringr::str_wrap(DVTERM, width=50))
adam_db %>% dunlin::log_filter(.data$DVCAT=="MAJOR", "addv")
}
run(pdt01, proc_data)
#> Error in tryCatch(withCallingHandlers({: 1 assertions failed:#> * Variable 'adam_db$addv$DVTERM': Must have length >= 1, but has#> * length 0.Createdon2024-07-01with [reprexv2.1.0](https://reprex.tidyverse.org/)
The text was updated successfully, but these errors were encountered:
It is not really an error but the message is missleading, the issue is that the number of levels in the variable should be >= 1 be It is actually ok if the variable is of length 0. (and there is no bug if it is a character.)
Should we be more tolerant, should we improve the error message or force the users to use
factors
?The text was updated successfully, but these errors were encountered: