Description Usage Arguments Value Note Author(s) References Examples
Compare two numeric vectors of same length for NAs and equals.
1 | compTwoNumVects(x, y, ...)
|
x |
vector one |
y |
vector of same length as x |
... |
arguments passed to further functions |
comparisons of vector contents with respect to equality and NAs
under continuous developement
Roland Rapold
none
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | if(base::require("car")) {
data(Mroz, package="carData")
str(Mroz)
dim(Mroz)
table(Mroz$wc, useNA="always")
set.seed(1234567)
Mroz[sample(nrow(Mroz), 5), "wc"] <- NA
Mroz$wc_new <- Mroz$wc
Mroz[sample(nrow(Mroz), 2), "wc"] <- NA
Mroz[sample(nrow(Mroz), 8), "wc_new"] <- NA
Mroz[sample(nrow(Mroz), 17), "wc_new"] <- "yes"
table(Mroz$wc, useNA="always")
table(Mroz$wc_new, useNA="always")
#
compTwoNumVects(Mroz$wc, Mroz$wc_new)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.