simpleFind: Get a variable from its name

Description Usage Arguments Author(s)

View source: R/utilities.R

Description

Primitive utility function, for writing functions that handle formula input. simpleFind looks first in the environment associated with the data argument. If nothing is found, it looks in the parent environment, and so on up the chain. The intent is to allow use of formula constructed from names of variables that may not appear in the data frame of interest, but which are present in the caller's environment (usually the Global Environment). Functions that use formulas now are more flexible in an interactive context.

To do: (1) find a way to make gentler error messages. (2) as with earlier versions of mosaic, we get the scoping problem when supplied data frame is named 'labels'.

Usage

1
simpleFind(varName,data)

Arguments

varName

Character string giving the name of the variable to be searched for.

data

Usually a data frame that supplies the some or all of the variables for a formula that is has been passed to the calling function.

Author(s)

Homer White hwhite0@georgetowncollege.edu


homerhanumat/tigerstats documentation built on Sept. 27, 2020, 3:21 a.m.