plotVar and block.spls, negative correlation warning

Issue #93 resolved
Former user created an issue

in plotVar.R (around line 350), the warning about negative correlation is generated by this code:

if (any(class.object %in%  object.blocks))
{
  VarX = do.call(cbind, lapply(object$variates, function(i) i[, ncomp]))
  corX = cor(VarX)
  if(any(corX < 0))
    warning("There is negative correlation between the variates of some blocks, be careful with the interpretation of the correlation circle.")
}

When you compute VarX, ncomp is used but ncomp is equal to object$ncomp (which is equal to the number of components for each block, eg c(6,6,6,6) for a run with 4 blocks and 6 components per block). It should be comp the parameter of the function, its value is by default c(1,2).

if (any(class.object %in%  object.blocks))
{
  VarX = do.call(cbind, lapply(object$variates, function(i) i[, comp]))
  corX = cor(VarX)
  if(any(corX < 0))
    warning("There is negative correlation between the variates of some blocks, be careful with the interpretation of the correlation circle.")
}

Comments (2)

  1. Log in to comment