Making data frames



next up previous contents
Next: attach() and detach() Up: Data frames Previous: Data frames

Making data frames

Objects satisfying the restrictions placed on the columns (components) of a data frame may be used to form one using the function data.frame:

accountants <- data.frame(home=statef,loot=income, shot=incomef)

A list whose components conform to the restrictions of a data frame may be coerced into a data frame using the function as.data.frame()

The simplest way to construct a data frame from scratch is to use the read.table() function to read an entire data frame from an external file. This is discussed further in §gif.



Erik Moledor
Tue Jan 31 21:02:18 EST 1995