Error when using plotIndiv.sgcca
I am trying to use plotIndiv on a result obtained from RGCCA::sgcca, however I am getting an error.
I tracked the issue and it seems to come from the line 143 of the plotIndiv.sgcca.R file where object$X
is called. In my object I don't have an X element, instead I have element Y. Changing this to object$Y
would correct this issue.
Comments (5)
-
repo owner -
repo owner - changed status to resolved
-
reporter Precisely I thought that
plotIndiv
having a method for classsgcca
would work with the output of sgcca of the RGCCA package. Sincerely having a "wrapper.sgcca" that outputs something of a different definition of the original object that it is mimicking is confusing. -
repo owner The wrapper.sgcca is a wrapper of sgcca. The results would be the same as RGCCA:sgcca if you used the same input parameters, but RGCCA does not provide any visualisation, so we had to tweak the function,
-
reporter No, the code of wrapper.sgcca doesn't call RGCCA (so it isn't a wrapper although does the same as far as I know) and the output is different from that of the RGCCA function. With your example and using RGCCA::sgcca:
> names(wrap.result.sgcca) [1] "call" "X" "variates" [4] "loadings" "loadings.star" "design" [7] "penalty" "scheme" "ncomp" [10] "crit" "AVE" "names" [13] "init" "tol" "iter" [16] "max.iter" "nzv" "scale" [19] "design" "scheme" "explained_variance" > result.sgcca = sgcca(data, C = design, c1 = c(.3,.5, 1), ncomp = c(2, 2, 2), scheme = "centroid") > names(result.sgcca) [1] "Y" "a" "astar" "C" "c1" "scheme" "ncomp" "crit" [9] "AVE"
As you can see one outputs Y and the other X, which makes the function of plotIndiv to fail as reported.
- Log in to comment
Hi Lluis, I believe you are trying to use different packages. plotIndiv is part of mixOmics only, not RGCCA. You could try use mixOmics::wrapper.sgcca and plotIndiv (which is part of mixOmics):