Is it possible to use package semPlot with R 3.6.2? - r

I upgraded R to version 3.6.2 and have discovered that package semPlot will not work. It installs without any problems, but when I try to load it I get the message,
Error: package or namespace load failed for ‘semPlot’ in
loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck =
vI[[j]]): there is no package called ‘ggm’
I then tried to install ggm but get the following warning and error:
Warning in install.packages : dependency ‘graph’ is not available
There is a binary version available but the source version is
later:
binary source needs_compilation ggm 2.3 2.5 FALSE installing the source package ‘ggm’ trying URL
'https://cran.rstudio.com/src/contrib/ggm_2.5.tar.gz' Content type
'application/x-gzip' length 109414 bytes (106 KB) downloaded 106 KB
ERROR: dependency ‘graph’ is not available for package ‘ggm’ removing
‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/ggm’
Warning in install.packages : installation of package ‘ggm’ had
non-zero exit status"
I then tried to install graph, but it says:
package ‘graph’ is not available (for R version 3.6.2).
I wondered if anyone else had experienced this problem, and had any solutions so I can load semPlot with R 3.6.2?
Many thanks.

I also have R 3.6.2 and get all errors you get. But when I try to install the semPlot package from GitHub, it works fine, as follows:
install.packages('devtools')
library(devtools)
install_github('SachaEpskamp/semPlot', dependencies = T)
library(semPlot)
Please not that I tried the cran/semPlot repository but didn't work for me, whereas SachaEpskamp/semPlot does.
Hope you get it working.

Related

Unable to load packages after updating Rstudio

I recently updated Rstudio to the latest version, but am now getting continuous error messages when I attempt to use install.packages and library().
Below is an example of what I'm seeing:
> install.packages("tidyverse", type="binary") ## Basic data manipulation
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/
trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.2/tidyverse_1.3.2.zip'
Content type 'application/zip' length 428925 bytes (418 KB)
downloaded 418 KB
package ‘tidyverse’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\King Awesome\AppData\Local\Temp\RtmpaU0srW\downloaded_packages
> library(tidyverse)
Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
namespace ‘cli’ 3.3.0 is already loaded, but >= 3.4.0 is required
In addition: Warning message:
package ‘tidyverse’ was built under R version 4.2.2
I'm pretty certain the issue has to do with my current working directory and library paths not matching, but I do not want to start making major changes without the advice of more experienced R users for fear of making the situation more complex.
> getwd()
[1] "C:/Users/King Awesome/Documents/Cyclistic Raw Data/Cyclistic Slice/Cyclistic Final 10 13/Cyclistic Final PT 10 13"
> .libPaths()
[1] "T:/Gaem/R-4.2.1/library"
It looks like the solution was a full wipe. I removed all installed packages, reinstalled and now have functionality again. Good solution, #PavoDive

Install/Compiling Errors with R Packages: tidyverse and caret

I recently had to install RStudio and the R language onto a new Macbook. It seemed to install the packages normally but when I started run some newly written code, the console would not execute tidyverse and caret even though it said it was downloaded. This is what shows up in the console and it's the same messages for both caret and tidyverse:
> install.packages("tidyverse")
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/tidyverse_1.3.1.tgz'
Content type 'application/x-gzip' length 421072 bytes (411 KB)
==================================================
downloaded 411 KB
The downloaded binary packages are in
/var/folders/pl/w9k_0l4d4snfgcv53rp2t_4m0000gn/T//RtmpWScbjK/downloaded_packages
> library(tidyverse)
Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘Rcpp’
I even tried to install it on just R and not RStudio too and This is the message that comes up for both tidyverse and caret when I try to install Rcpp both ways on just R and RStudio:
> install.packages("Rcpp")
There is a binary version available but the source version is later:
binary source needs_compilation
Rcpp 1.0.8.2 1.0.8.3 TRUE
Do you want to install from sources the package which needs compilation? (Yes/no/cancel) yes
installing the source package ‘Rcpp’
trying URL 'https://cloud.r-project.org/src/contrib/Rcpp_1.0.8.3.tar.gz'
Content type 'application/x-gzip' length 3086192 bytes (2.9 MB)
==================================================
downloaded 2.9 MB
* installing *source* package ‘Rcpp’ ...
** package ‘Rcpp’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
ERROR: compilation failed for package ‘Rcpp’
* removing ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/Rcpp’
The downloaded source packages are in
‘/private/var/folders/pl/w9k_0l4d4snfgcv53rp2t_4m0000gn/T/Rtmp53AysU/downloaded_packages’
Warning message:
In install.packages("Rcpp") :
installation of package ‘Rcpp’ had non-zero exit status
I'm not sure what's going wrong and I'm not seeing any solution on here or other sites that are working for me, I'd appreciate any help with this since I use R alot. If more info is needed please comment, thanks.
It could be that you need to reinstall the rlang package. You can use this code to reinstall this package:
remove.packages("rlang")
install.packages("rlang")
After that you can load the packages tidyverse and caret again:
library(tidyverse)
library(caret)
Check this question for more info: Error: package or namespace load failed for ‘tidyverse’ in loadNamespace

Can't install caret package in R

I have tried multiple ways to install the caret package in R.
The error message that I receive is as follows:
Error: package or namespace load failed for ‘caret’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘dimRed’
When I try to install dimRed, I get the following message:
Installing package into ‘C:/Users/Thomas/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
Warning in install.packages :
dependency ‘Biobase’ is not available
There is a binary version available but the source version is later:
binary source needs_compilation
dimRed 0.1.0 0.2.1 FALSE
installing the source package ‘dimRed’
trying URL 'https://cran.rstudio.com/src/contrib/dimRed_0.2.1.tar.gz'
Content type 'application/x-gzip' length 363025 bytes (354 KB)
downloaded 354 KB
ERROR: dependency 'Biobase' is not available for package 'dimRed'
* removing 'C:/Users/Thomas/Documents/R/win-library/3.4/dimRed'
In R CMD INSTALL
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-34~1.4/bin/x64/R" CMD INSTALL -l "C:\Users\Thomas\Documents\R\win-library\3.4" C:\Users\Thomas\AppData\Local\Temp\RtmpqKhsKn/downloaded_packages/dimRed_0.2.1.tar.gz' had status 1
Warning in install.packages :
installation of package ‘dimRed’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\Thomas\AppData\Local\Temp\RtmpqKhsKn\downloaded_packages’
Per previous posts, I have updated RStudio. I have attempted an install from install_url.
Any suggestions are welcome.
I was able to figure this out.
Simply typing install.packages won't work. In order to install Biobase, you have to run the following code in R console:
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("Biobase", version = "3.8")
More info: https://bioconductor.org/packages/release/bioc/html/Biobase.html
Once this step is done, I installed caret again using
install.packages("caret",dependencies = T)
And then it worked.
Warning ...
install.packages("BiocManager")
This only works if your R version is >= 3.5.0
for info I've the same problem under a Centos and a Windows.
issue solved on the windows with 3.5.1 R version. Not yet solved on the centOS (3.4.2)

Cannot remove prior installation of package, but package not found

I have been installing packages into R since the day I downloaded it. Version 3.4.1. Today it gave me an issue when I tried to install a new package, SLOPE that had me update and reboot R. I said okay. However, in doing so I then went to call packages using the library and it told me:
> Error: package or namespace load failed for ‘plyr’ in loadNamespace(j
> <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): there
> is no package called ‘Rcpp’
I have clicked around on here and it looks like I need to download and install the Rccp package. I tried that and got this answer:
install.packages("Rcpp") Installing package into ‘\tgdcfs01/Users/jsmith/Documents/R/win-library/3.4’ (as ‘lib’ is
unspecified) trying URL
'https://mran.microsoft.com/snapshot/2017-09-01/bin/windows/contrib/3.4/Rcpp_0.12.12.zip'
Content type 'application/zip' length 3319164 bytes (3.2 MB)
downloaded 3.2 MB
package ‘Rcpp’ successfully unpacked and MD5 sums checked Warning in
install.packages : cannot remove prior installation of package
‘Rcpp’
The downloaded binary packages are in
C:\Users\jsmith\AppData\Local\Temp\RtmpYHBW2f\downloaded_packages
So then I tried uninstalling Rccp and got this message:
remove.packages(Rcpp)
Error in remove.packages : object 'Rcpp' not found
What am I missing?
In order to fix it, I in fact did not update R in the first place. I needed to do the following:
install.packages("installr")
library(installr)
updateR()
Then I updated R, but I did not use the recommended setting of using R Gui. Then I was able to re-install packages and go from there.

Different version of GlobalOptions package in R

I'm trying to install the package "circlize" and I am having trouble resolving what seems to be a simple error.
When I run:
install.packages("circlize")
It says:
Installing package into ‘*file location*/3.2’
(as ‘lib’ is unspecified)
Warning in install.packages :
dependency ‘GlobalOptions’ is not available
There is a binary version available but the source version is later:
binary source needs_compilation
circlize 0.3.10 0.4.3 FALSE
installing the source package ‘circlize’
trying URL 'https://mirrors.sorengard.com/cran/src/contrib/circlize_0.4.3.tar.gz'
Content type 'application/x-gzip' length 2456906 bytes (2.3 MB)
downloaded 2.3 MB
* installing *source* package 'circlize' ...
** package 'circlize' successfully unpacked and MD5 sums checked
** R
** demo
** inst
** preparing package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace 'GlobalOptions' 0.0.11 is being loaded, but >= 0.0.12 is required
ERROR: lazy loading failed for package 'circlize'
* removing '*file location*/3.2/circlize'
Warning in install.packages :
running command '"*file location*/x64/R" CMD INSTALL -l "*file location*\3.2" *file location*/downloaded_packages/circlize_0.4.3.tar.gz' had status 1
Warning in install.packages :
installation of package ‘circlize’ had non-zero exit status
The downloaded source packages are in
‘*file location*\downloaded_packages’
These parts seem most relevant to me:
dependency ‘GlobalOptions’ is not available
namespace 'GlobalOptions' 0.0.11 is being loaded, but >= 0.0.12 is required
When I run sessionInfo() I see under "other attached packages": [1] GlobalOptions_0.0.11
My best guess is that I have the wrong version of GlobalOptions -- I see that GlobalOptions v0.0.13 is available here, but being new to R, I'm not sure what to do now to get the right version up and running.
I'd really appreciate if someone could tell me where I should look next. (I looked through the documentation within that link, but I'm still lost about what to do now.) Thanks!
If you have R version >=3.3.0 you should
install GlobalOptions_0.0.13 from CRAN
install.packages("GlobalOptions")
quit and restart R
re-install circlize from source as before.
If you have an older R version, update R to a more recent version first.

Resources