rpucor {rpud} | R Documentation |
This function computes the correlation matrix of two multivariate statistics.
## Default S3 method: rpucor(x, y = NULL, use = "everything", method = c("pearson", "spearman", "kendall", "gamma"), ...)
x |
a numeric vector, matrix or data frame. |
y |
a vector, matrix or data frame with compatible dimensions to 'x'. The default 'NULL' value is equivalent to 'y = x'. |
use |
a string representing the method to handle missing values.
Currently supported values are: |
method |
a string representing the name of the correlation to be
computed. The supported values are: |
... |
further arguments to be passed to or from methods. |
Perform the Kendall correlation with GPU using the rpudplus add-on for rpud. The Pearson and Spearman correlation are just stubs that invoke the default implementation of R. In absense of rpudplus, rpud computes the Kendall correlation also with the stock R implementation, and there will be no speed gain.
The correlation matrix of the input statistics.
An attribute named "method"
contains the name of the correlation,
and another attribute named "use"
contains the method to handle missing values.
cor, gpuCor
## Not run: num <- 5 dim1 <- 6 dim2 <- 8 x <- matrix(runif(num*dim1), num, dim1) y <- matrix(runif(num*dim2), num, dim2) rpucor(x, y, method = "kendall") # introduce missing values x[3,5] <- NA y[4,1] <- NA rpucor(x, y, method = "kendall", use="pairwise.complete.obs") ## End(Not run)