mirror of
https://github.com/agdamsbo/REDCapCAST.git
synced 2025-04-11 01:52:31 +02:00
Compare commits
No commits in common. "053c4447adef85cd393d98f0113eca6ff9e536c1" and "87505daeeba58909c8a9b9fec82ec5ab52fa02bb" have entirely different histories.
053c4447ad
...
87505daeeb
@ -46,8 +46,6 @@ as_factor.logical <- function(x, ...) {
|
|||||||
set_attr(x, labels, overwrite = FALSE)
|
set_attr(x, labels, overwrite = FALSE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#' @rdname as_factor
|
#' @rdname as_factor
|
||||||
#' @export
|
#' @export
|
||||||
as_factor.numeric <- function(x, ...) {
|
as_factor.numeric <- function(x, ...) {
|
||||||
@ -300,11 +298,11 @@ named_levels <- function(data, label = "labels", na.label = NULL, na.value = 99)
|
|||||||
#' sample(c(TRUE, FALSE), 10, TRUE) |> possibly_roman()
|
#' sample(c(TRUE, FALSE), 10, TRUE) |> possibly_roman()
|
||||||
#' rep(NA, 10) |> possibly_roman()
|
#' rep(NA, 10) |> possibly_roman()
|
||||||
possibly_roman <- function(data) {
|
possibly_roman <- function(data) {
|
||||||
|
# browser()
|
||||||
if (all(is.na(data))) {
|
if (all(is.na(data))) {
|
||||||
return(FALSE)
|
return(FALSE)
|
||||||
}
|
}
|
||||||
identical(as.character(data),
|
identical(as.character(data), as.character(utils::as.roman(data)))
|
||||||
as.character(suppressWarnings(utils::as.roman(data))))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ NULL
|
|||||||
#' @rdname fct_drop
|
#' @rdname fct_drop
|
||||||
#' @export
|
#' @export
|
||||||
fct_drop.data.frame <- function(x, ...) {
|
fct_drop.data.frame <- function(x, ...) {
|
||||||
purrr::map(x, \(.x){
|
purrr::map(\(.x){
|
||||||
if (is.factor(.x)){
|
if (is.factor(.x)){
|
||||||
forcats::fct_drop(.x)
|
forcats::fct_drop(.x)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user