R installation won't let me open packages library issue - r

Hi so I'm having trouble with R studios on my desktop where it won't let me open any packages.
When I attempt to install a package with install.packages() like Tidyverse I get this error.
Error in library("tidyverse") : there is no package called ‘tidyverse’
Show in New Window Error in install.Rtools() : could not find function
"install.Rtools" Show in New Window WARNING: Rtools is required to
build R packages but is not currently installed. Please download and
install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/ Installing package into
‘C:/Users/athen/Documents/R/win-library/4.1’ (as ‘lib’ is unspecified)
trying URL
'https://cran.rstudio.com/bin/windows/contrib/4.1/tidyverse_1.3.1.zip'
Content type 'application/zip' length 430128 bytes (420 KB) downloaded
420 KB
Then when I try to load the package into my library with library("tidyverse") I receive this error
Error: package or namespace load failed for ‘tidyverse’ in inDL(x, as.logical(local), as.logical(now), ...):
unable to load shared object 'C:/Program Files/R/R-4.1.2/library/stats/libs/x64/stats.dll':
LoadLibrary failure: The specified module could not be found.
This error isn't just for tidyverse but all packages I try to run. I have uninstalled R and RStudios multiple times, but the error doesn't go away. I have been to IT at my university and they were completely baffled. Please help if you can, I really need R to work for both my job and classes.

Related

R Fails to Library Packages

I am having trouble on getting R to library packages to use tools such as ggplot. I have reinstalled R to try and remedy the issue to no avail. Currently I can install packages normally install.packages(ggplot2) I am later given the potentially key message
Installing package into ‘/Users/jet/Library/R/arm64/4.1/library’
(as ‘lib’ is unspecified)
Installation returns to normal and I select my CRAN mirror and am left with
The downloaded binary packages are in
/var/folders/1w/nbtkj1314rnbdv3djd0vm7zw0000gn/T//RtmpOkNNTZ/downloaded_packages
Later when I try and library the packageslibrary(ggplot) I receive the following error.
Error: package or namespace load failed for ‘ggplot2’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Users/jet/Library/R/arm64/4.1/library/colorspace/libs/colorspace.so':
dlopen(/Users/jet/Library/R/arm64/4.1/library/colorspace/libs/colorspace.so, 0x0006): Library not loaded: /opt/homebrew/opt/r/lib/R/lib/libR.dylib
Referenced from: /Users/jet/Library/R/arm64/4.1/library/colorspace/libs/colorspace.so
Reason: tried: '/opt/homebrew/opt/r/lib/R/lib/libR.dylib' (no such file), '/usr/local/lib/libR.dylib' (no such file), '/usr/lib/libR.dylib' (no such file)
What should I do to resolve this issue?

Error downloading tidycensus library in R

I am trying to use the census_api_key() function in tidycensus, but keep getting an error that it can't be found, nor does it seem like the tidycensus library is being installed properly according to the error messages I am receiving.
Here is what I've done so far:
> install.packages("tidycensus")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/matia/OneDrive/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/tidycensus_0.11.4.zip'
Content type 'application/zip' length 2683556 bytes (2.6 MB)
downloaded 2.6 MB
> library(tidycensus)
Error: package or namespace load failed for ‘tidycensus’:
object ‘is_present’ is not exported by 'namespace:lifecycle'
In addition: Warning message:
package ‘tidycensus’ was built under R version 3.6.3
> census_api_key("my key")
Error in census_api_key("my key") :
could not find function "census_api_key"
I've also tried installing the rgdal library, as was suggested for other tidycensus errors, but this hasn't worked for me.
Any suggestions are greatly appreciated.

The package Rmpi is already installed, but R returns "Loading required package: Rmpi"

I'm trying to run parallel computing. Hence I install package Rmpi.
install.packages("Rmpi")
require("Rmpi")
Could you please elaborate why there is such error message while I've just installed the package?
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
Installing package into �C:/Users/Dung Le/Documents/R/win-library/4.0�
(as �lib� is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/Rmpi_0.6-9.zip'
Content type 'application/zip' length 353588 bytes (345 KB)
downloaded 345 KB
package ‘Rmpi’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\Dung Le\AppData\Local\Temp\RtmpGm7Riu\downloaded_packages
Loading required package: Rmpi
Error: package or namespace load failed for �Rmpi�:
.onLoad failed in loadNamespace() for 'Rmpi', details:
call: inDL(x, as.logical(local), as.logical(now), ...)
error: unable to load shared object 'C:/Users/Dung Le/Documents/R/win-library/4.0/Rmpi/libs/x64/Rmpi.dll':
LoadLibrary failure: The specified module could not be found.
PS: I use Windows 10 Pro with version 2004 and build 19041.508. My R is 4.0.2.

Getting error while installing other packages in R after installing Rtool40 packages

I am facing problem installing any/other packages after I installed the package "Rtools40" in R version 4.0.2. Here is the error I get:
Error in inDL(x, as.logical(local), as.logical(now), ...) :
unable to load shared object 'C:/Program Files/R/R-3.6.1/library/stats/libs/x64/stats.dll':
LoadLibrary failure: The specified module could not be found.
I have tried deleting the hidden file of Rtools40 called "./Renviron" still it didn't work for me. Even reinstalled the whole package Rtools40 in my device but I am still getting same error while installing any other R packages like DESeq2.
Please help me to deal with this error.
Thank you for your time.

R bioconductor mzR library load error

Hope somebody could help me .. I'm trying to install the mzmatch.R package for metabolomics, following the instructions here: http://mzmatch.sourceforge.net/tutorial.mzmatch.r.php
I'm completely new to R so this is my first time doing this sort of thing. First, I downloaded the latest version of R and installed it on Mac OSX 10.7. This is the version of R that I have running:
R 2.15.0 GUI 1.51 Leopard build 64-bit (6148)
Then I launched R64.app and typed the following commands (as specified in the instructions in the link above) to install the package and all its dependencies.
> source("http://bioconductor.org/biocLite.R")
> biocLite(c("faahKO", "xcms", "multtest"))
> install.packages(c("rJava","XML","snow","caTools","bitops","ptw"))
> source ("http://puma.ibls.gla.ac.uk/mzmatch.R/install_mzmatch.R")
The last step will always fail with the following message:
trying URL 'http://puma.ibls.gla.ac.uk/mzmatch.R/mzmatch.R.tar.gz'
Content type 'application/x-gzip' length 104535 bytes (102 Kb)
opened URL
==================================================
downloaded 102 Kb
* installing *source* package ‘mzmatch.R’ ...
** R
** preparing package for lazy loading
Error : .onLoad failed in loadNamespace() for 'mzR', details:
call: value[[3L]](cond)
error: failed to load module Ramp from package mzR
could not find function "errorOccured"
Error : package ‘mzR’ could not be loaded
ERROR: lazy loading failed for package ‘mzmatch.R’
* removing ‘/Library/Frameworks/R.framework/Versions/2.15/Resources/library/mzmatch.R’
Warning message:
In install.packages(pkgs = "mzmatch.R.tar.gz", repos = NULL, type = "source") :
installation of package ‘mzmatch.R.tar.gz’ had non-zero exit status
I thought this was because the library "mzR" cannot be loaded, so I tried:
> biocLite("mzR")
> library("mzR")
and sure enough, the same error appeared:
Loading required package: Rcpp
Error : .onLoad failed in loadNamespace() for 'mzR', details:
call: value[[3L]](cond)
error: failed to load module Ramp from package mzR
could not find function "errorOccured"
Error: package/namespace load failed for ‘mzR’
I'm quite lost now, and not sure what to do at all. Thanks for reading !
Assuming you are running mzR v1.2.1 and Rcpp v0.9.12, the problem you see is an unfortunate and unexpected incompatibility between the two. In the meantime, downgrading to Rcpp_0.9.10.zip will fix the issue. Hope to commit a proper fix soon.
Laurent
UDAPE: The issue was the result of compiler/linker error and required a fresh mzR build, which is now available through biocLite.

Resources