Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R-3.5.3 on WIN10 Pro - Error: package or namespace load failed for '...' in rbind(info, getNamespaceInfo(env, "S3methods")): number of columns of matrices must match (see arg 2) #179

Closed
gwd999 opened this issue May 19, 2019 · 12 comments

Comments

@gwd999
Copy link

gwd999 commented May 19, 2019

load library for "core-tidyverse-package" (i.e. tidyverse, ggplo2, dplyr, tidyr, readr, purrr, tibble) except stringr and forcats" fails with matrices column not match error

Package load via library (...) or require (...) package or namespace load fails for the packages mentioned above; the same error is also encountered for devtools, haven, modelr.
For stringr, forcats (from tidyverse core) as well as blob, DBI, lubridate, readxl, rvest package loading via library() works fine

library("tidyverse")#or ggplot2, dplyr, tidyr, readr, purrr, tibble, devtools, haven or modelr
Error: package or namespace load failed for 'tidyverse' in rbind(info, getNamespaceInfo(env, "S3methods")):
 number of columns of matrices must match (see arg 2)

my sessionInfo() output

>sessionInfo() 
R version 3.5.3 (2019-03-11)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)

Matrix products: default

locale:
[1] C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.5.3 fortunes_1.5-5

Versions listing for the mentioned packages

Failing packages:

  • tidyverse 1.2.1
  • ggplot2 3.1.1
  • dplyr 0.8.1
  • tidyr 0.8.3
  • readr 1.3.1
  • purrr 0.3.2
  • tibble 2.1.1
  • devtools 2.0.2
  • haven 2.1.0
  • modelr 0.1.4
  • vroom 1.0.0

Working packages:

  • stringr 1.4.0
  • forcats 0.4.0
  • blob 1.1.1
  • DBI 1.0.0
  • lubridate 1.7.4
  • readxl 1.3.1
  • rvest 0.3.4
@kgmccann
Copy link

kgmccann commented May 28, 2019

Same issue with 3.5.3

`R version 3.5.3 (2019-03-11)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.5.3 tools_3.5.3   
`

and 3.5.0

`R version 3.5.0 (2018-04-23)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.5.0 tools_3.5.0 `

This only became an issue for me after I installed R 3.6.0

@gwd999
Copy link
Author

gwd999 commented May 30, 2019

I also noticed that I receive 'lazy-loading' file errors when trying to update the tibble package from source w R-3.5.3
Same as @kgmccann I also have both R-3.5.3 and R-3.6.0 installed next to each other on my machine; I might also add that the installation directory is C:\R\R.version and not C:\Program Files …
Installing from source and starting eg tibble is no problem under R-3.6.0
All of the above actions are being executed in RStudio 1.2.1335

@yangleicq
Copy link

Same issue with me, only occurs after I install R-3.6.0.

@Radmila-R-lady
Copy link

I am currently experiencing the same issue. I installed 3.6.0 so I could run tree package and then suddenly I lose tidyverse packages and no possibility to install them.

@hadley
Copy link
Member

hadley commented Jun 13, 2019

Did you reinstall all packages for 3.6, or did you try and use your old R 3.5 packages?

@Radmila-R-lady
Copy link

Radmila-R-lady commented Jun 13, 2019

I updated old ones.

@sunnyjones5
Copy link

I am having the same problem even after having reinstalled all the packages for 3.6. This doesn't happen when I run R locally on my mac but if I send in scripts to my job's linux based computing cluster I get this error.

@hadley
Copy link
Member

hadley commented Jun 13, 2019

I am almost 100% certain this is due to having a mix of packages for R 3.5 and 3.6 installed in the same library:

# In R 3.5
env <- asNamespace("MASS")
head(getNamespaceInfo(env, "S3methods"))
#>      [,1]      [,2]        [,3]             
#> [1,] "["       "fractions" "[.fractions"    
#> [2,] "[<-"     "fractions" "[<-.fractions"  
#> [3,] "addterm" "default"   "addterm.default"
#> [4,] "addterm" "glm"       "addterm.glm"    
#> [5,] "addterm" "lm"        "addterm.lm"     
#> [6,] "addterm" "mlm"       "addterm.mlm"

# In R 3.6
env <- asNamespace("MASS")
head(getNamespaceInfo(env, "S3methods"))
#>      [,1]      [,2]        [,3]              [,4]
#> [1,] "["       "fractions" "[.fractions"     NA  
#> [2,] "[<-"     "fractions" "[<-.fractions"   NA  
#> [3,] "addterm" "default"   "addterm.default" NA  
#> [4,] "addterm" "glm"       "addterm.glm"     NA  
#> [5,] "addterm" "lm"        "addterm.lm"      NA  
#> [6,] "addterm" "mlm"       "addterm.mlm"     NA  

The chances are that some time in the distant past you have followed some advice that means that you don't have to re-install packages when you re-install R. Unfortunately the advice you followed is bad, because it leads to situations exactly like this.

You may be able to fix the problem by forcing a re-install of all packages:

update.packages(ask = FALSE, checkBuilt = TRUE)

You must use checkBuilt = TRUE in order for this to work.

This is not a tidyverse issue, so I'm going to close it, but feel free to continue discussion here.

@hadley hadley closed this as completed Jun 13, 2019
@gwd999
Copy link
Author

gwd999 commented Jun 24, 2019

Hmm ... in order to avoid such issues I had I implemneted a strict seggregation of libPatrhs for major versions; I again checked if there is some form of fraternization between the available LIB paths.
If I start RStudio with R version 3.5.3 the .libPaths() looks like
"S:/Sdocuments/R/win-library/3.5" "C:/R/R-3.5.3/library"
and with 3.6.0
"S:/Sdocuments/R/win-library/3.6" "C:/R/R-3.6.0/library"
so I am not sure why I get the reported behaviour when trying to load a bunch of packages from the tidyverse?
For instance the ggplot2 package is available under my 3.5.3 libpath tree in version 3.1.1. and under the 3.6.0 tree in version 3.2.0. - STILL 3.1.1 it will no longer load after I installing 3.6.0 R-version alongside 3.5.3!
And since the last modify date of the ggplot package in the 3.5.3 tree is 4 weeks before I even downloaded the new R version I am "guessing" that the problem is a different one. But I will keep looking ...

@smithingellz
Copy link

Hadley's advice worked for me. Not just with tidyverse, but several other packages that were throwing a variation on the same error for scripts running from taskscheduleR.

Thanks!

@gwd999
Copy link
Author

gwd999 commented Jun 25, 2019

Still not working for me - did (in R-3.5.3) update.packages(chechBuild = TRUE), reinstalled the ggplot2 packages - still the same error on the same packages as mentioned above. :-(

@gwd999
Copy link
Author

gwd999 commented Jun 25, 2019

Did you reinstall all packages for 3.6, or did you try and use your old R 3.5 packages?

Maybe it was not as clear in the first place - I have absolutey no issue with 3.6. IT IS 3.5. THAT IS BROKEN! At least for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants