Learn R Programming

replyr (version 0.3.01)

replyr_inTest: Product a column noting if another columns values are in a given set.

Description

#' Note: if temp tables can't be used a regular table is created and destroyed (which may not be safe if there is another replyr_inTest running at the same time).

Usage

replyr_inTest(x, cname, values, nname, ...,
  tempNameGenerator = makeTempNameGenerator("replyr_inTest"),
  verbose = TRUE)

Arguments

x

tbl or item that can be coerced into such.

cname

name of the column to test values of.

values

set of values to check set membership of.

nname

name for new column

...

force later parameters to bind by name

tempNameGenerator

temp name generator produced by replyr::makeTempNameGenerator, used to record dplyr::compute() effects.

verbose

logical if TRUE echo warnings

Value

table with membership indications.

Examples

Run this code

values <- c('a','c')
d <- data.frame(x=c('a','a','b',NA,'c','c'),y=1:6,
                stringsAsFactors=FALSE)
replyr_inTest(d,'x',values,'match')

Run the code above in your browser using DataLab