50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

rgr (version 1.1.0)

df.test: Check for the existence of a Dataframe

Description

A utility function to determine if a dataframe is attached, or exists in the working directory. If the dataframe exists the names of the variables are displayed.

Usage

df.test(dfname, x = NULL)

Arguments

dfname
name of a data frame.
x
setting x to an expected variable name in the dataframe results in the variable's length, i.e. number of observations, being displayed if it is present.

Details

Based on a function shared on S-News.

See Also

search, ls

Examples

Run this code
## Make test data available
data(kola.o)

## Check that the dataframe kola.o is available
df.test(kola.o)

## Check that kola.o is available and that the variable Cu is present
df.test(kola.o, x = Cu)

Run the code above in your browser using DataLab