Learn R Programming

pivotea (version 1.0.2)

has_col: Detect if df has col

Description

Detect if df has col

Usage

has_col(df, col)

Value

A dataframe.

Arguments

df

A dataframe.

col

A string or string vector.

Examples

Run this code
colnames(mtcars)
has_col(mtcars, c("mpg", "cyl"))
has_col(mtcars, c("mpg", "foo"))

Run the code above in your browser using DataLab