Description Usage Arguments Details Author(s) See Also Examples
View source: R/ds.correlation.R
This functions calculates the correlation coefficient of the input vectors, matrix or data frame. By default, the correlation coefficient of pearson is computed.
1 | ds.correlation(x, y = NULL, cor.method = "pearson", tojson = FALSE)
|
x |
A numeric vector, matrix or data frame |
y |
A vector, matrix or data frame with same dimension as x. By default it is equal with NULL. |
cor.method |
The correlation coefficient method to compute: "pearson" (default), "kendall" or "spearman". |
tojson |
If TRUE the results are returned in json format, default returns a data frame |
This function returns an upper triangle matrix with the correlation coefficients of the input data. The correlation coefficient of pearson is computed, by default. Other options are "kendall" or "spearman".
Aikaterini Chatzopoulou, Kleanthis Koupidis, Charalampos Bratsas
1 2 3 4 5 6 7 | # iris data frame as an input and the default parameters
ds.correlation(iris, cor.method = "pearson", tojson = FALSE)
# with matrix as an input , different parameters and json output
Matrix <- cbind(Uni05 = (1:200)/21, Norm = rnorm(200),
`5T` = rt(200, df = 5), Gam2 = rgamma(200, shape = 2))
ds.correlation(Matrix, cor.method = "kendall", tojson = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.