Last data update: 2014.03.03

R: Correlations matrices
matcorR Documentation

Correlations matrices

Description

The function computes the correlation matrices within and between two datasets.

Usage

matcor(X, Y)

Arguments

X

numeric matrix (n * p), containing the X coordinates.

Y

numeric matrix (n * q), containing the Y coordinates.

Value

A list containing the following components:

Xcor

Correlation matrix (p * p) for the X variables

Ycor

Correlation matrix (q * q) for the Y variables

XYcor

Correlation matrix ((p+q) * (p+q)) between X and Y variables

Author(s)

Sébastien Déjean, Ignacio González

See Also

img.matcor

Examples

data(nutrimouse)
X=as.matrix(nutrimouse$gene)
Y=as.matrix(nutrimouse$lipid)
correl=matcor(X,Y)
img.matcor(correl)
img.matcor(correl,type=2)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(CCA)
Loading required package: fda
Loading required package: splines
Loading required package: Matrix

Attaching package: 'fda'

The following object is masked from 'package:graphics':

    matplot

Loading required package: fields
Loading required package: spam
Loading required package: grid
Spam version 1.3-0 (2015-10-24) is loaded.
Type 'help( Spam)' or 'demo( spam)' for a short introduction 
and overview of this package.
Help for individual functions is also obtained by adding the
suffix '.spam' to the function name, e.g. 'help( chol.spam)'.

Attaching package: 'spam'

The following objects are masked from 'package:base':

    backsolve, forwardsolve

Loading required package: maps

 # maps v3.1: updated 'world': all lakes moved to separate new #
 # 'lakes' database. Type '?world' or 'news(package="maps")'.  #


> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/CCA/matcor.Rd_%03d_medium.png", width=480, height=480)
> ### Name: matcor
> ### Title: Correlations matrices
> ### Aliases: matcor
> ### Keywords: multivariate
> 
> ### ** Examples
> 
> data(nutrimouse)
> X=as.matrix(nutrimouse$gene)
> Y=as.matrix(nutrimouse$lipid)
> correl=matcor(X,Y)
> img.matcor(correl)
> img.matcor(correl,type=2)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>