[R] Concepts question: environment, frame, search path

Graham Wideman gwlist at grahamwideman.com
Tue May 1 06:29:47 CEST 2007


I'd appreciate if someone could straighten me out on a few concepts which 
are described a bit ambiguously in the docs.

1.  data.frame:
Refan p84: 'A data frame is a list of variables of the same length with 
unique row names, given class "data.frame".'

I probably don't need to point out how opaque that is!

Anyhow, key question: Some places in the docs seem pretty firm that a 
data.frame is basically a 2-D array with:
a) named rows and
b) columns whose items within a column be of uniform data type.

Elsewhere, it seems like a data.frame can be a collection of arbitrary 

2. environment
Refman p122:  "Environments consist of a frame, or collection of named 
objects, and a pointer to an enclosing environment."

Is the "or" here explaining parenthetically that a frame is a collection of 
named objects, or is separating too alternative structures for an 

If the former, does this imply that a frame can contain arbitrary variables?

And "pointer"? Is that a type of thing in R?

3.  R search path; attach()
The R search path appears to hold the list of "collections of data" (my 
term) that can be accessed by a users' commands. Refman p27 tells that 
search path can hold items that are data.frame, list, environment or R data 
file (on disk).  Yet R-intro p28 describes attach() as taking a "directory 
name" argument.  What is the concept "directory" in this context?




More information about the R-help mailing list