x = c(1, 5, 9, 7, 4, 6, 8, 2, 3) y = c(4, 3, 6, 8, 2, 7, 9, 1, 5) cor(x,y, method = "spearman")
## [1] 0.7166667
cor.test(x,y, method = "spearman")
## ## Spearman's rank correlation rho ## ## data: x and y ## S = 34, p-value = 0.03687 ## alternative hypothesis: true rho is not equal to 0 ## sample estimates: ## rho ## 0.7166667