## 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.estim)
# 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
my.colors = color.mixo(as.numeric(nutrimouse$genotype))
plotIndiv(rcc.result, ind.names = nutrimouse$diet, col = my.colors)
Run the code above in your browser using DataLab