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

Ken Spriggs ksspriggs at gmail.com
Thu Feb 28 16:12:50 CET 2008


Thanks.

> find("cor")
[1] "package:fUtilities" "package:stats"   



Rolf Turner-3 wrote:
> 
> 
> 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}}
> 
> ______________________________________________
> 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.
> 
> 

-- 
View this message in context: http://www.nabble.com/Error-in-cor.default%28x1%2C-x2%29-%3A-missing-observations-in-cov-cor-tp15723848p15738523.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list