Learn R Programming

eatTools (version 0.7.8)

whereAre: Matches a scalar with elements of a vector.

Description

The function closely resembles the match function, but allows for multiple matches.

Usage

whereAre(a,b,verbose=TRUE)

Value

A numeric vector

Arguments

a

a scalar

b

a numeric or character vector

verbose

logical: print messages on console?

Author

Sebastian Weirich

Examples

Run this code
a <- 12
b <- c(10, 11, 12, 10, 11, 12)
match(a, b)
whereAre(a=a, b=b)

Run the code above in your browser using DataLab