compTwoNumVects: Compare two numeric vectors

Description Usage Arguments Value Note Author(s) References Examples

View source: R/compare.R

Description

Compare two numeric vectors of same length for NAs and equals.

Usage

1

Arguments

x

vector one

y

vector of same length as x

...

arguments passed to further functions

Value

comparisons of vector contents with respect to equality and NAs

Note

under continuous developement

Author(s)

Roland Rapold

References

none

Examples

 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)
}

rrMisc documentation built on June 25, 2021, 3 a.m.