0

I am trying to load package "Matrix" and get this error:

Error : Function found when exporting methods from the namespace ‘Matrix’ which is not S4 generic: ‘as.vector’ In addition: Warning message: package ‘Matrix’ was built under R version 3.3.0 Error: package or namespace load failed for ‘Matrix’

I have tried restarting and installing etc.

One thing I have tried is this (R Cannot allocate memory though memory seems to be available)

wd <- getwd()
assign('.First', function(x) {
  require('Matrix') #and whatever other packages you're using
  file.remove(".RData") #already been loaded
  rm(".Last", pos=.GlobalEnv) #otherwise won't be able to quit R without it restarting
  setwd(wd)
}, pos=.GlobalEnv)
assign(".Last", function() {
  system("R --no-site-file --no-init-file --quiet")
}, pos=.GlobalEnv)
save.image() #or only save the things you want to be reloaded.
q("no")

But I cant seem to get that solution working to try and see if it will load under "Vanilla" R

Edit: I was able to try and load the package under "Vanilla" R but I still get the same error

Community
  • 1
  • 1
Adam Sanders
  • 125
  • 11
  • Is your R version outdated perhaps? – Axeman Feb 17 '16 at 19:09
  • On 3.2.3. Thing is it works on one computer, but not on this one, so hence I was trying to load it under vanilla in case it is some other package causing the error – Adam Sanders Feb 17 '16 at 19:19
  • Can you include the `sessionInfo()`? What exactly are you running? Is it the code above or was that your fix? – MrFlick Feb 17 '16 at 20:01

0 Answers0