[Rd] cor() and cor.test() (PR#9781)

From: <kristle.krichbaum_at_gmail.com>
Date: Thu, 05 Jul 2007 21:48:47 +0200 (CEST)


Hello,

I am trying to make a correlation matrix in R using cor() and also to get the p-value for each correlation using cor.test(). I can't get these commands to work. I'm getting errors like the following:

cor(Pollution, Wet.days)
Error in inherits(x, "data.frame") : Object "Wet.days" not found cor("Pollution", "Wet.days")
Error in cor("Pollution", "Wet.days") : missing observations in cov/cor In addition: Warning messages:
1: NAs introduced by coercion
2: NAs introduced by coercion

I know that "Wet.days" is there because when I type the name of the data set (Pollution) it appears. There are no missing values in the data set for there to be any NAs coerced. This is the example given in Mick Crawley's book on R with Pollution data so it should definitely work.

Can you help me to get it working, please? Kristle

-- 
Kristle Krichbaum
Graduate Assistant
Hudson Lab
208 Mueller Lab
University Park, PA 16801
www.cidd.psu.edu

	[[alternative HTML version deleted]]

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Thu 05 Jul 2007 - 20:33:28 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 06 Jul 2007 - 01:36:00 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.