Learn R Programming

fritools (version 3.3.0)

compare_vectors: Compare Two Vectors

Description

Side-by-side comparison of two vectors. The vectors get sorted and are compared element-wise. So the result will be as long as the union of the two vectors plus their number of values unique to one of them.

Usage

compare_vectors(x, y, differences_only = FALSE)

Arguments

x, y

Two vectors of the same mode.

differences_only

Report only the differences?

Value

A matrix containing the side-by-side comparison.

See Also

Other searching functions: file_modified_last(), find_files(), fromto(), missing_docs, search_files(), search_rows(), summary.filesearch()

Examples

Run this code
# NOT RUN {
data(mtcars)
cars <- rownames(mtcars)
carz <- cars[-grep("Merc", cars)]
cars <- cars[nchar(cars) < 15]
cars <- c(cars, "foobar")
compare_vectors(cars, carz)
# }

Run the code above in your browser using DataLab