Error showing while loading "dplyr" package in R. - r

ibrary("dplyr")
Gives the following errors.
Error: package or namespace load failed for ‘dplyr’ in library.dynam(lib, package, package.lib):
shared object ‘rlang.so’ not found
In addition: Warning message:
S3 methods ‘$.rlang_data_pronoun’, ‘$.rlang_fake_data_pronoun’, ‘$<-.quosures’, ‘$<-.rlang_data_pronoun’, ‘[.quosures’, ‘[.rlang_data_pronoun’, ‘[.rlang_envs’, ‘[.stack’, ‘[<-.quosures’, ‘[[.rlang_data_pronoun’, ‘[[.rlang_fake_data_pronoun’, ‘[[<-.quosures’, ‘[[<-.rlang_data_pronoun’, ‘Math.quosure’, ‘Ops.quosure’, ‘Summary.quosure’, ‘as.character.quosure’, ‘as.list.quosures’, ‘c.quosures’, ‘c.rlang_envs’, ‘conditionMessage.rlang_error’, ‘format.rlang_trace’, ‘length.rlang_data_pronoun’, ‘length.rlang_fake_data_pronoun’, ‘mean.quosure’, ‘median.quosure’, ‘names.rlang_data_pronoun’, ‘names.rlang_fake_data_pronoun’, ‘print.frame’, ‘print.quosure’, ‘print.quosures’, ‘print.rlang_data_pronoun’, ‘print.rlang_envs’, ‘print.rlang_error’, ‘print.rlang_fake_data_pronoun’, ‘print.rlang_lambda_function’, ‘print.rlang_trace’, ‘print.rlang_zap’, ‘ [... truncated]
But while specify the lib path as .libPaths( "/usr/lib/R/library/" ) and then loading library will load the dplyr package and does not gives error.
I would like to know actually what is the issue behind this.
Also install.package("dplyr") on R console is also not working.
It gives error like:
Error in library.dynam(lib, package, package.lib) :
shared object ‘rlang.so’ not found
ERROR: lazy loading failed for package ‘dplyr’

There is a problem with the "dplyr" package. This issue is due to the the latest rlang installed on a version of R for which binaries are no longer built....
Try restarting your R-Studio
https://cran.r-project.org/bin/macosx/ : Install Suitable versions in the link according
to your system requirements and update the R on your device
Try updating your R to the latest version
Alternate Answer:
Would recommend waiting until the binaries are available on CRAN for dplyr > 0.7.4 before making a breaking change that requires 0.7.6
install.packages("dplyr")
Installing package into ‘ ...
(as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
dplyr 0.7.4 0.7.7 TRUE
Do you want to install from sources the package which needs compilation?
y/n:

Related

How to fix "package ‘RcmdrMisc’ is not available (for R version 3.4.4)" on Ubuntu 18.04

I am trying to run rcommander in Rstudio Version 1.2.5001, (I am on Ubuntu 18.04) when I launch
library(Rcmdr)
I get:
Error: package or namespace load failed for ‘RcmdrMisc’ in library.dynam(lib, package, package.lib):
shared object ‘haven.so’ not found
Error: package ‘RcmdrMisc’ could not be loaded
In addition: Warning message:
S3 methods ‘[.haven_labelled’, ‘[.haven_labelled_spss’, ‘as.data.frame.haven_labelled’, ‘as_factor.data.frame’, ‘as_factor.haven_labelled’, ‘as_factor.labelled’, ‘format.pillar_shaft_haven_labelled_chr’, ‘format.pillar_shaft_haven_labelled_num’, ‘is.na.haven_labelled_spss’, ‘print.haven_labelled’, ‘print.haven_labelled_spss’, ‘type_sum.haven_labelled’, ‘zap_formats.data.frame’, ‘zap_formats.default’, ‘zap_label.data.frame’, ‘zap_label.default’, ‘zap_labels.data.frame’, ‘zap_labels.default’, ‘zap_labels.haven_labelled’, ‘zap_labels.haven_labelled_spss’, ‘zap_missing.data.frame’, ‘zap_missing.default’, ‘zap_missing.haven_labelled’, ‘zap_missing.haven_labelled_spss’, ‘zap_widths.data.frame’, ‘zap_widths.default’ were declared in NAMESPACE but not found
trying install.packages("RcmdrMisc") I get:
Installing package into ‘/home/marco/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘RcmdrMisc’ is not available (for R version 3.4.4)
However If i try to install r-cran-rcmdrmisc (1.0-7-1) on my system with apt-get I get:
r-cran-rcmdrmisc is already the newest version (1.0-7-1).
I don't know what to do to fix the issue and run rcommander :(
Help?
Thank you all for your help. I was successfully able to update R (I think..) however now when I run library(Rcmdr)
Loading required package: splines
Loading required package: RcmdrMisc
Loading required package: car
Error: package or namespace load failed for ‘car’ in readRDS(pfile):
cannot read workspace version 3 written by R 3.6.1; need R 3.5.0 or newer
Error: package ‘car’ could not be loaded
After restarting again Rstudio I got:
Error in readRDS(file) :
cannot read workspace version 3 written by R 3.6.1; need R 3.5.0 or newer
install.packages("rcmdr")
Installing package into ‘/home/marco/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘rcmdr’ is not available (for R version 3.4.4)
I am puzzled :/

unable to install "dplyr" package in R

While installing the dplyr package I am getting the error in RStudio, whereas if I am trying to install the same in R, I ma getting an error saying:
package dplyr is not available (for R version 3.5.2)
this is the error I am getting in RStudio:
Error: package or namespace load failed for ‘dplyr’ in library.dynam(lib, package, package.lib):
DLL ‘bindrcpp’ not found: maybe not installed for this architecture?
Have you checked what version of R you are using? Just use the
version
command. If it's less than 3.5.2 you might find that libraries dplyr requires aren't being installed and that's why it's failing to find, for example, bindrcpp.
In my corporate environment I had a very similar issue trying to install dplyr after our tech support operation upgraded my PC, but installed a too-old version of R.

R package updates

I have been having some issues accessing an updated version of a package in R.
On running a workflow for data analysis I got this error message:
library(dplyr)
Error: package or namespace load failed for ‘dplyr’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
namespace ‘rlang’ 0.2.1 is already loaded, but >= 0.2.2 is required
I therefore tried to update both the "dplyr" and "rlang" packages.
On updating I get the messages:
Installing package into ‘C:/Users/tomsp/OneDrive/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
trying URL 'https://cran.ma.imperial.ac.uk/bin/windows/contrib/3.5/rlang_0.2.2.zip'
Content type 'application/zip' length 820944 bytes (801 KB)
downloaded 801 KB
package ‘rlang’ successfully unpacked and MD5 sums checked
Warning: cannot remove prior installation of package ‘rlang’
The downloaded binary packages are in
C:\Users\tomsp\AppData\Local\Temp\RtmpmooXKa\downloaded_packages
However if I check the package using the code below it still has version 0.2.1
packageVersion("rlang")
[1] ‘0.2.1’
I checked my library paths and still have not managed to be run the latest version(0.2.2) of the package rlang.
Any advice of what I am doing wrong or how I can solve this?
Restart R and run install.packages again. On Windows, you can't update a package that's already loaded, if the package contains compiled C/C++/Fortran code. This includes dplyr and rlang.
To be doubly sure, before you run install.packages, go to your R packages directory (C:/Users/tomsp/OneDrive/Documents/R/win-library/3.5) and delete any zero-length files that are present. These are artifacts of failed install attempts and will break install.packages if present.
For any reason, at least in Windows, some R processes may still be running in background. Close your current R session, kill all processes related to R and try again.
If you are using Windows, check if the package you are trying to upgrade is available only as a source file.
If you try to install a package that needs compilation, you need the software Rtools. Download it on cran.r-project.org/bin/windows/Rtools/. Updating Rtools might also resolve your problem. The console message for a particular package is like that:
binary source needs_compilation
backports 1.2.0 1.2.1 TRUE
On Linux you don't need Rtools, but read the console output when you see an error when you try to install or update a package. If some software is missing, the error message on Linux is self-explanatory.
Deleted the entire library from R packages directory on my local computer. Installed again after terminating the session. Worked for me.

Rcmndr plugin not running

I am trying to run this rcmndr plugin for my class and it's not working. I installed all the necessary packages and it appeared to install correctly but I am getting this package or namespace load failure. The GUI appears for a split second when I enter the library command, then disappears with the error. It seems to be an issue with the namespace and .onattach but I couldn't find any existing answers or resources for this issue.
https://cran.r-project.org/web/packages/RcmdrPlugin.BCA/index.html
> library(RcmdrPlugin.BCA)
Loading required package: Rcmdr
Loading required package: splines
Loading required package: RcmdrMisc
Loading required package: car
Loading required package: sandwich
Rcmdr Version 2.2-3
Loading required package: BCA
Warning: package 'BCA' was built under R version 3.2.3
Loading required package: flexclust
Warning: package 'flexclust' was built under R version 3.2.3
Loading required package: grid
Loading required package: lattice
Loading required package: modeltools
Loading required package: stats4
Error : .onAttach failed in attachNamespace() for 'RcmdrPlugin.BCA', details:
call: get(Menus[m, 5])
error: object 'importRODBCtable' not found
In addition: Warning messages:
1: package ‘RcmdrPlugin.BCA’ was built under R version 3.2.3
2: package ‘Rcmdr’ was built under R version 3.2.3
3: package ‘RcmdrMisc’ was built under R version 3.2.3
4: package ‘car’ was built under R version 3.2.3
Error: package or namespace load failed for 'RcmdrPlugin.BCA'
I got alternative to run this plugin in R commander.
Open R Commander by using:
library(Rcmdr)
R Commander dialogue box will appear.
In R Script load BCA library-
lapply(list('BCA', 'splines', 'RcmdrMisc', 'car', 'sandwich', 'flexclust', 'grid','lattice','modeltools','stats4','RODBC'), require, character.only = TRUE)
Click on Submit button.
If you don't have RODBC package (which is not there in my case), install it separately and then run above commands. To install use:
install.packages("RODBC")
And now you exactly have what you will get after loading RcmdrPlugin.BCA library.
I faced a similar situation. Having tried a bunch of things - none worked - I finally uninstalled R and deleted the remaining files from under the "Program Files" directory in Windows. I then reinstalled R and RcmdrPlugin.BCA and this time it worked.
You could also refer to this URL for help http://r.789695.n4.nabble.com/Unable-to-run-RcmdrPlugin-survival-using-3-2-2-with-Windows-10-td4711796.html

R package installation error: no package called ‘org.Hs.eg.db’

I am trying to install this package http://bioconductor.org/packages/release/data/annotation/html/org.Hs.eg.db.html. When I try to load org.Hs.eg.db using library (org.Hs.eg.db) , gives me this
error: Error in library(org.Hs.eg.db) :
there is no package called ‘org.Hs.eg.db’
It says the packages are downloaded here:
The downloaded source packages are in
‘/tmp/Rtmpgy1ZJE/downloaded_packages’
What could be the reason for this?
If you run into this error nowadays you have to install the package using
BiocManager::install("org.Hs.eg.db")

Resources