updated docs
Some checks failed
pkgdown.yaml / pkgdown (push) Has been cancelled

This commit is contained in:
Andreas Gammelgaard Damsbo 2025-03-31 14:37:28 +02:00
commit f73af16ae1
No known key found for this signature in database
10 changed files with 69 additions and 17 deletions

View file

@ -342,3 +342,24 @@ data_description <- function(data) {
signif(100 * p_complete, 3)
)
}
#' Drop-in replacement for the base::sort_by with option to remove NAs
#'
#' @param x x
#' @param y y
#' @param na.rm remove NAs
#' @param ... passed to base_sort_by
#'
#' @returns
#' @export
#'
#' @examples
#' sort_by(c("Multivariable", "Univariable"),c("Univariable","Minimal","Multivariable"))
sort_by <- function(x,y,na.rm=FALSE,...){
out <- base::sort_by(x,y,...)
if (na.rm==TRUE){
out[!is.na(out)]
} else {
out
}
}