selectByMultCols: Select all rows that have a value in certain columns.

Description Usage Arguments

View source: R/advanced_R_studies.R

Description

Takes in a dataframe, and returns a dataframe with all rows where at least one column defined in 'cols' contains any of the values defined in 'values'.

Example:
countryCols <- c("origin", "transit", "destination")
df <- fixMultCols(df, countryCols, "United States")

Usage

1
selectByMultCols(df, cols, values)

Arguments

df

The dataframe you wish to select.

cols

The names of the columns you wish to select with.

values

A character vector that contains that values you wish to select with.


C-Research/c4aRs documentation built on Sept. 2, 2021, 1:10 p.m.