[R] Newbie syntax question
jim holtman
jholtman at gmail.com
Sun Jan 13 04:08:39 CET 2008
?cor.test
and the help page says:
formula: a formula of the form ~ u + v, where each of u and v are
numeric variables giving the data values for one sample. The samples
must be of the same length.
On 1/12/08, Joe Trubisz <jtrubisz at mac.com> wrote:
> Hi...
>
> I'm trying to understand the following syntax:
>
> cor.test(~mortality + hardness,data=water,method="pearson")
>
> which is the same as:
>
> cor.test(water$mortality,water$hardness,data=water,method="pearson")
>
> Can anyone point me to the correct doc or explain to me how to
> interpret "~mortality + hardness"?
>
> Thanks,
> Joe
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
Jim Holtman
Cincinnati, OH
+1 513 646 9390
What is the problem you are trying to solve?
More information about the R-help
mailing list