Learn R Programming

ProgGUIinR (version 0.0-4)

find_vars: return variable names in a data frame or environment matching some condition

Description

return variable names in a data frame or environment matching some condition

default method

character method

data frame method

find variables

Usage

find_vars(x, cond = function(x) TRUE)
"find_vars"(x, cond = function(x) TRUE)
"find_vars"(x, cond = function(x) TRUE)
"find_vars"(x, cond = function(x) TRUE)
"find_vars"(x, cond = function(x) TRUE)

Arguments

x
a data frame,data frame name in the global workspace or an environment
cond
a function to apply to each column of the data frame Only those matching a returned

Value

a character vector of variable names.

Examples

Run this code
library(MASS) # for Cars93 data frame
find_vars(Cars93, cond=is.factor)

Run the code above in your browser using DataLab