dfEnv: Create R Environment from data frame

Description Usage Arguments Value Examples

View source: R/dfEnv.R

Description

This function allows one to scrape rows and columns from an already existing dataframe to create an environment in R containing vectors corresponding to the rows or columns of the data frame or add such variables to an already-existing environment.

Usage

1
dfEnv(df, orientation = "cols", global = TRUE)

Arguments

df

A data frame.

orientation

One of "rows" or "cols" to specify whether arrays are to be created from the rows or columns of the data frame. Defaults to "cols". If set to "rows", the df must have row names.

global.

A boolean indicating whether the variables are to be loaded into the existing environment or returned as an object. Defaults to TRUE.

Value

NULL. Creates an R environment.

Examples

1
2
3
4
5
6
## Not run: 
df <- data.frame(x = 1:3, y = 4:6)

dfEnv(df)

## End(Not run)

frank113/enviRonmental documentation built on May 14, 2019, 5:13 a.m.