## tuning the regularization parameters for 'rcc'
# ----------------------------------------------------
data(nutrimouse)
X <- nutrimouse$lipid
Y <- nutrimouse$gene
# create a list as an input
A = list(X, Y)
param = sapply(A, tau.estimate)
# regularisation parameters for X (first) and then Y
param
# note: we advise scaling the data as the rcc input in that case
rcc.result = rcc(scale(X), scale(Y), ncomp = 2, lambda1 = param[1], lambda2 = param[2])
# we observe quite a good deparation of the diets
plotIndiv(rcc.result, ind.names = nutrimouse$diet, group = nutrimouse$genotype)
Run the code above in your browser using DataLab