1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 22:41:52 +02:00

(v1.8.1.9002) fix for table() on MICs

This commit is contained in:
2022-05-09 17:08:40 +02:00
parent 4754848e96
commit 152db9d1b5
21 changed files with 742 additions and 2179 deletions

View File

@ -214,13 +214,6 @@ as.double.mic <- function(x, ...) {
as.double(gsub("[<=>]+", "", as.character(x), perl = TRUE))
}
#' @method as.integer mic
#' @export
#' @noRd
as.integer.mic <- function(x, ...) {
as.integer(gsub("[<=>]+", "", as.character(x), perl = TRUE))
}
#' @method as.numeric mic
#' @export
#' @noRd
@ -231,7 +224,7 @@ as.numeric.mic <- function(x, ...) {
#' @method droplevels mic
#' @export
#' @noRd
droplevels.mic <- function(x, exclude = if (any(is.na(levels(x)))) NULL else NA, as.mic = TRUE, ...) {
droplevels.mic <- function(x, exclude = if (any(is.na(levels(x)))) NULL else NA, as.mic = FALSE, ...) {
x <- droplevels.factor(x, exclude = exclude, ...)
if (as.mic == TRUE) {
class(x) <- c("mic", "ordered", "factor")