[R] Error in cor.default(x1, x2) : missing observations in cov/cor

Rolf Turner r.turner at auckland.ac.nz
Thu Feb 28 00:08:09 CET 2008


On 28/02/2008, at 11:11 AM, Ken Spriggs wrote:

>
> I get the following
>
>> class(x1)
> [1] "numeric"
>> class(x2)
> [1] "numeric"
>
> and:
>
>> cor(x1,x2)
> Error in cor.default(x1, x2) : missing observations in cov/cor
>> traceback()
> 2: cor.default(x1, x2)
> 1: cor(x1, x2)

``Clearly'' you must be using a non-standard cor.  As Peter Dalgaard
pointed out, cor() is not generic and there is no such function as
cor.default() in ``standard R''.

Suggestions:

* Try find("cor") to see what package you are actually using.

* Detach that package from the search list --- or remove cor from  
that position on
   the search list --- then you'll get the ``standard R'' version of  
cor() and all will be well.

	cheers,

		Rolf Turner

######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}



More information about the R-help mailing list