moveToDF: Move or copy "freestanding" variables into a data frame.

View source: R/moveToDF.R

moveToDFR Documentation

Move or copy "freestanding" variables into a data frame.

Description

Variables are specified by pattern, which is a regular expression. The modal length of all variables in the calling environment that match pattern is determined. Matching variables are then moved to a data frame (or copied to a data frame if move is FALSE). pattern may be NULL, in which case all variables in the calling environment will be examined.

Usage

moveToDF(pattern = NULL, move = TRUE)

Arguments

pattern

String that specifies a regular expression. It is NULL by default, in which case all variables in the environment are examined for inclusion in the data frame.

move

Logical variable.

Details

If there are multiple modal lengths of the objects in the calling environment, all modes will be used. For example, if the calling environment has 20 objects of length\NB1, 20 objects of length\NB2, and one object of length\NB3, the returned data frame may have as many as 40 columns.

Variables that have the "dim" attribute – for example, arrays and matrices – will not be moved into the new data frame. Functions will never be moved into the new data frame, either.

Value

Data frame containing all one-dimensional variables that have names matching pattern and that have the modal length of those variables.


jbullock35/Bullock documentation built on April 1, 2022, 6:21 p.m.