0
votes

I know there is a function for this and have used it in the past but can't seem to remember or find it.

basically I'm trying to do the following:

data(mtcars)

missing_function(mtcars)

lm(mpg ~ cyl)

where "missing_function()" allows me to use the the variables in the mtcars dataset without having to use the "$". For example: "mpg" instead of "mtcars$mpg".

1
Use with or transformAndrie

1 Answers

2
votes

Though generally frowned upon, attach will do that for you

R> attach(mtcars)
R> mpg
 [1] 21 21 23 21 19 18 14 24 23 19 18 16 17 15 10 10 15 32 30 34 22 16 15 13 19 27 26 30
[29] 16 20 15 21
R>