Error in predict.mvr(object, newdata = newdata)

Issue #129 resolved
Former user created an issue

Hi,

I have problem to use the predict function. every first time when I open r the plsda model predict works. however, I cannot repeat the prediction and get following error message:

Error in predict.mvr(object, newdata = newdata) : 'newdata' does not have the correct number of columns

I have to quite R and restart to be able to use "predict" again. I also got same proble when I use the tune.plsda or perf functions.

best regards, KY

Comments (4)

  1. Kim-Anh Le Cao repo owner

    Dear KY,

    there is a clash between the package pls and the mixOmics package. The predict.mvr() belongs to the pls package, this is why it is complaining. Best way is either to detach the pls package, or run mixOmics::predict(....) if you are using that particular function. Let us know if you are experiencing further issues.

    Thank you for using mixOmics,

    Kim-Anh & Florian

  2. Kang Yu

    Many thanks Kim-Anh for the explanation! but I still had another issue when using mixOmics::predict(....)

    Error: 'predict' is not an exported object from 'namespace:mixOmics'

    I have updated the mixOmics package to the latest version.

    Kang

  3. Florian Rohart

    Hi there,

    Sorry for the long wait, I didn't see that last message. The latest version on github should solve your problem, you will be able to use predict() normally, even with the 'pls' package loaded.

    library(devtools)
    install_github("mixOmicsTeam/mixOmics")
    
  4. Log in to comment