Depreciated collapse Functions
The functions Recode
and replace_non_finite
available until collapse v1.1.0 will be removed soon. Since v1.2.0, Recode
is replaced by recode_num
and recode_char
and replace_non_finite
is replaced by replace_Inf
. Since version 1.5.1, is.regular
is depreciated - the function is not very useful and clashes with a more important one in the zoo package.
Recode(X, ..., copy = FALSE, reserve.na.nan = TRUE, regex = FALSE) replace_non_finite(X, value = NA, replace.nan = TRUE) is.regular(x)
X |
a vector, matrix or data frame. |
x |
an R object. |
... |
comma-separated recode arguments of the form: |
value |
a single (scalar) value to replace matching elements with. Default is |
copy |
logical. For reciprocal or sequential replacements of the form |
reserve.na.nan |
logical. |
regex |
logical. If |
replace.nan |
logical. |
Recode
is not suitable for recoding factors or other classed objects / columns, it simply does X[X == value] <- replacement
in a more efficient way. For classed objects, see for example dplyr::recode
.
## Not run: Recode(c("a","b","c"), a = "b", b = "c") Recode(c("a","b","c"), a = "b", b = "c", copy = TRUE) Recode(c("a","b","c"), a = "b", b = "a", copy = TRUE) Recode(month.name, ber = NA, regex = TRUE) mtcr <- Recode(mtcars, `0` = 2, `4` = Inf, `1` = NaN) replace_non_finite(mtcr) replace_non_finite(mtcr, replace.nan = FALSE) ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.