NAs in "cor"? (was: Re: [R] (no subject))

From: Spencer Graves <spencer.graves_at_pdf.com>
Date: Thu 17 Mar 2005 - 09:04:51 EST

      "?cor" revealed that the "cor" function has an argument "use" with a default of "all.obs" and options of "complete.obs"' or '"pairwise.complete.obs". Either of these other two should get you past this error message.

      hope this helps.
      spencer graves

p.s. As indicated by earlier remarks on this list, the posting guide "http://www.R-project.org/posting-guide.html" has helped people answer their own questions in the process of preparing a question for this list. You may wish to try it if you haven't already.

Brett Stansfield wrote:

>Dear R
>I'm trying to do a correlation matrix for some variables I have.
>Unfortunately there are some NA entries for some of the variables
>I tried the following
>
>cor(sleep[c("logbw", "logbrw", "SlowSleep", "ParaSleep", "loglife",
>"loggest")])
>
>but it told me
>Error in cor(sleep[c("logbw", "logbrw", "SlowSleep", "ParaSleep", "loglife",
>:
> missing observations in cov/cor
>
>How can I get R to conduct a correlation matrix for this data set??
>
>brett
>
>______________________________________________
>R-help@stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Mar 17 09:14:45 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:50 EST