lookfor: Look For Variables

Description Usage Arguments Value Examples

View source: R/lookfor.R

Description

'lookfor' searches for string in variable names and labels, just like the 'lookfor' command in Stata.

Usage

1
lookfor(df, kw)

Arguments

df

The input 'df' should be a data frame. 'lookfor' works best with labelled data frames (from the 'haven' package).

kw

The keyword to search, 'kw', should be a string of length 1.

Value

'lookfor(df, kw)' returns a data frame that contains rows which match the keyword being searched.

Examples

1
2
nlsw88 = haven::read_dta("http://www.stata-press.com/data/r13/nlsw88.dta")
lookfor(nlsw88, "mar") # search for variables that are related to marriage

jjchern/meda documentation built on May 19, 2019, 11:38 a.m.