ds.correlation: Correlation Coefficient of a dataframe

Description Usage Arguments Details Author(s) See Also Examples

View source: R/ds.correlation.R

Description

This functions calculates the correlation coefficient of the input vectors, matrix or data frame. By default, the correlation coefficient of pearson is computed.

Usage

1
ds.correlation(x, y = NULL, cor.method = "pearson", tojson = FALSE)

Arguments

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

Details

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".

Author(s)

Aikaterini Chatzopoulou, Kleanthis Koupidis, Charalampos Bratsas

See Also

ds.analysis, open_spending.ds

Examples

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)

DescriptiveStats.OBeu documentation built on May 4, 2020, 9:06 a.m.