Skip to content
Prev 366555 / 398502 Next

How to automatically create data frames from an existing one?

You can use the 'with' function or the 'data' argument to many functions
to use the variables in the data frame without copying them out to the
global environment.  Leaving them in the data.frame keeps them from
getting lost among the temporary variables in the global environment.
+ "Name,Education,Wage
+ Abe,PhD,105
+ Bob,MS,108
+ Chuck,BS,118
+ Dave,PhD,102")
BS    MS   PhD
118.0 108.0 103.5
Call:
lm(formula = Wage ~ Education - 1, data = Data)

Coefficients:
 EducationBS   EducationMS  EducationPhD
       118.0         108.0         103.5


Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Wed, Jan 11, 2017 at 3:53 AM, Tunga Kantarc? <tungakantarci at gmail.com> wrote: