Use variables from formula in R function -


i'd write function of type myfunction(y,data), y being column name of data. have idea on how code in order able use formula myfunction(y~,data=mydata) when calling it?

also, how can use someything of form data$y within function?

maybe should take @ model.frame:

model.frame(formula= z~y,data=data.frame(y=1:3,x=1:3,z=1:3))   z y 1 1 1 2 2 2 3 3 3 

the result data.frame containing variables used in formula.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -