[R] what does this error mean?
Thomas W Blackwell
tblackw at umich.edu
Sat Sep 13 21:52:06 CEST 2003
See the example "run a simulation" in help("try").
This won't be able to tell you the Spearman correlation
when there are fewer than two pairs of non-missing values,
but it will allow the loop to keep running. Caution: the
return value from try() will be a string with the error
message, when cor.test() fails, so whatever variable
you accumulate the simulation results in must be able
to tolerate string values. That suggests using a list.
- tom blackwell - u michigan medical school - ann arbor -
On Sat, 13 Sep 2003 szhan at uoguelph.ca wrote:
> Dear R-users:
> I am runing R 1.6.2 with Windows XP. I try to calculate Pearson correlation
> and Spearman correlation of any pairwise columns of 8000 x 80 data matrix with
> missing values and randomize the matix 1000 times and calculate this two
> correlations again. The code bellow for Pearson is working fine but for
> Spearman got the error bellow for randomized data matrix and R console is stop
> cor (raw2[,i], raw2[,j], use="complete.obs")
> cor.test (raw2[,i], raw2[,j], method="spearman", na.action = "na.omit")
> Error in cor.test.default(raw2[, i], raw2[, j], method = "spearman",
> na.action = "na.omit") :
> not enough finite observations
> In addition: There were 50 or more warnings (use warnings() to see
> the first 50)
> What does the Error mean? How to fix it?
> Any suggestion are highly appreciated?
More information about the R-help