-
Book Overview & Buying
-
Table Of Contents
R for Data Science
By :
In R, there are several packages that provide the correlation functionality to the programmer. We will be using the following packages in this chapter:
corrgram: This is the tool to graphically display correlations
Hmisc: This contains a variety of miscellaneous R functions
polycor: This contains functions to compute polychoric correlations
ggm: This contains functions for analyzing and fitting graphical Markov models
Basic correlation is performed in R using the cor function. The cor function is defined as follows:
cor(x, y = NULL,
use = "everything",
method = c("pearson", "kendall", "spearman"))The various parameters of this function are described in the following table:
|
Parameter |
Description |
|---|---|
|
|
This is the dataset. |
|
|
This is the dataset that is compatible with |
|
|
This is the optional method for computing the covariance of missing values assigned. The choices are:
|
|
|
Change the font size
Change margin width
Change background colour