[R] Turning off warnings from cor.test
Dimitris Rizopoulos
d.rizopoulos at erasmusmc.nl
Fri Apr 17 09:44:49 CEST 2009
check option 'warn' in the on-line help file of ?options(), e.g., you
can use something like this:
op <- options(warn = (-1)) # suppress warnings
cor.test(c(1,2,3,3,4,5), c(1,2,3,3,4,5), method = "spearman")
options(op) # reset the default value, if you want
I hope it helps.
Best,
Dimitris
Daren Tan wrote:
> I would like to turn off the warnings from cor.test while retaining
> exact=NULL. Is that possible ?
>
>> cor.test(c(1,2,3,3,4,5), c(1,2,3,3,4,5), method = "spearman")
>
> Spearman's rank correlation rho
>
> data: c(1, 2, 3, 3, 4, 5) and c(1, 2, 3, 3, 4, 5)
> S = 0, p-value < 2.2e-16
> alternative hypothesis: true rho is not equal to 0
> sample estimates:
> rho
> 1
>
> Warning message:
> In cor.test.default(c(1, 2, 3, 3, 4, 5), c(1, 2, 3, 3, 4, 5), method =
> "spearman") :
> Cannot compute exact p-values with ties
>
> ______________________________________________
> 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.
>
--
Dimitris Rizopoulos
Assistant Professor
Department of Biostatistics
Erasmus University Medical Center
Address: PO Box 2040, 3000 CA Rotterdam, the Netherlands
Tel: +31/(0)10/7043478
Fax: +31/(0)10/7043014
More information about the R-help
mailing list