Friday, 15 March 2013

r faq - Use of ~ (tilde) in R programming Language -



r faq - Use of ~ (tilde) in R programming Language -

i saw in tutorial regression modeling next command :

myformula <- species ~ sepal.length + sepal.width + petal.length + petal.width

what command do, , role of ~ (tilde) in command?

the thing on right of <- formula object. used denote statistical model, thing on left of ~ response , things on right of ~ explanatory variables. in english language you'd "species depends on sepal length, sepal width, petal length , petal width".

the myformula <- part of line stores formula in object called myformula can utilize in other parts of r code.

other mutual uses of formula objects in r

the lattice bundle uses them specify variables plot. ggplot2 bundle uses them specify panels plotting. dplyr bundle uses them non-standard evaulation.

r r-faq

No comments:

Post a Comment