
Last chance! 50% off unlimited learning
Sale ends in
rd.cor
Read a correlation matrix into R. The resulting matrix is named mycor
. All coefficients for each variable must be on one row. No variable names are in the file to be read.
corRead(ref=NULL, names=NULL)rd.cor(...)
http://
.mycor
. All coefficients for each variable must be on one row. No variable names are in the file to be read. The coefficients within each row, that is, for a single variable, are delimited by a white space, such as one or more blanks. The standard R function used to read the matrix is read.table
.
By default the variables are named V1, V2, etc. If the names
option is invoked, then the specified names are attached to the respective rows and columns of the matrix. Here it may be convenient to name the variables with the lessR
function to
.
The alternative is to calculate the correlations from the data, such as with the lessR
function Correlation
or the standard R function cor
.
Correlation
, read.table
.# browse for the data file because ref is omitted
# name the variables with the lessR function to
# corRead(names=to("m",20))
# abbreviated form
# read a matrix with 4 variables and specify the names
# rd.cor(names=c("m06","m07","m09","m10"))
Run the code above in your browser using DataLab