compare_vectors | R Documentation |
Compare numeric or logical vectors.
compare_vectors(..., sep = "", diff.char = "|")
... |
vectors of the same length |
sep |
a string |
diff.char |
a single character |
The function compares vectors with one another. The main purpose is to print a useful representation of differences (and return differences, usually invisibly).
The function is still experimental and will likely change.
depends on how the function is called; typically a list
Enrico Schumann
neighbourfun
x <- runif(5) > 0.5
nb <- neighbourfun(type = "logical")
compare_vectors(x, nb(x))
## 01010
## |
## 00010
## The vectors differ in 1 place.
nb <- neighbourfun(type = "logical", stepsize = 2)
compare_vectors(x, nb(x))
## 01010
## | |
## 11011
## The vectors differ in 2 places.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.