Compare commits

...

2 Commits

Author SHA1 Message Date
053c4447ad
include data... 2024-11-27 15:49:45 +01:00
21f7b0cb83
suppressing warnings in test 2024-11-27 15:49:35 +01:00
2 changed files with 5 additions and 3 deletions

View File

@ -46,6 +46,8 @@ as_factor.logical <- function(x, ...) {
set_attr(x, labels, overwrite = FALSE)
}
#' @rdname as_factor
#' @export
as_factor.numeric <- function(x, ...) {
@ -298,11 +300,11 @@ named_levels <- function(data, label = "labels", na.label = NULL, na.value = 99)
#' sample(c(TRUE, FALSE), 10, TRUE) |> possibly_roman()
#' rep(NA, 10) |> possibly_roman()
possibly_roman <- function(data) {
# browser()
if (all(is.na(data))) {
return(FALSE)
}
identical(as.character(data), as.character(utils::as.roman(data)))
identical(as.character(data),
as.character(suppressWarnings(utils::as.roman(data))))
}

View File

@ -15,7 +15,7 @@ NULL
#' @rdname fct_drop
#' @export
fct_drop.data.frame <- function(x, ...) {
purrr::map(\(.x){
purrr::map(x, \(.x){
if (is.factor(.x)){
forcats::fct_drop(.x)
} else {