Install and use pcalg in R on Mac M1 from Terminal - r

I am trying to install and use pcalg (details) in R (R-4.2.1-arm64.pkg) from terminal using the following commands:
install.packages("pcalg", dependencies = TRUE)
library(pcalg)
I get this error after the second step:
Error: package or namespace load failed for ‘pcalg’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘graph’
The first command gives the following message:
Warning: dependencies ‘graph’, ‘RBGL’, ‘Rgraphviz’ are not available
trying URL 'https://cloud.r-project.org/bin/macosx/big-sur-arm64/contrib/4.2/pcalg_2.7-7.tgz'
Content type 'application/x-gzip' length 6500355 bytes (6.2 MB)
==================================================
downloaded 6.2 MB
The downloaded binary packages are in
/var/folders/2b/q__z5z855qq_36mk8xf33b380000gp/T//RtmpVzspPi/downloaded_packages
Is there any missing step here? I want to eventually do this through rpy2 for python.

Looking at the package's CRAN page I see that graph, RBGL and Rgraphviz are not on CRAN but on Bioconductor. You need to install them with the BiocManager.

Related

ggpmisc Error: package or namespace load failed for ‘ggpmisc’

I am trying to use the library ggpmisc and even though the installation went okey it gives me an error when I try to open the library. How can I solve it?
install.packages("ggpmisc")
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 'https://cran.rstudio.com/bin/windows/contrib/4.1/ggpmisc_0.4.5.zip'
Content type 'application/zip' length 1349360 bytes (1.3 MB)
downloaded 1.3 MB
package ‘ggpmisc’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\dkafe\AppData\Local\Temp\Rtmpkh620g\downloaded_packages
library(ggpmisc)
Error: package or namespace load failed for ‘ggpmisc’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘conquer’ In addition: Warning message:
package ‘ggpmisc’ was built under R version 4.1.3

Problem in calling the function panelvar from the library after being installed

I was working with the panelvar package, that I have installed today.I created a new R script, and ran library(panelvar) and got the following error:
library(panelvar)
Error: package or namespace load failed for ‘panelvar’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘hms’
In fact, I had already installed the package:
install.packages("panelvar")
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 'https://cran.rstudio.com/bin/windows/contrib/3.6/panelvar_0.5.2.zip'
Content type 'application/zip' length 2565900 bytes (2.4 MB)
downloaded 2.4 MB
package ‘panelvar’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\JSamridhi\AppData\Local\Temp\Rtmp0GEDNw\downloaded_packages
When I try uploading the package, I get the same error again. I tried deleting the file from the library using .libpath and reinstalled the whole thing but its just not working.

Is it possible to use package semPlot with R 3.6.2?

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.

Can't load library R Studio

I am trying to install the ggmap library:
install.packages("ggmap")
library(ggmap)
This is what I get though:
Installing package into ‘my path’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/ggmap_2.6.1.zip'
Content type 'application/zip' length 4563151 bytes (4.4 MB)
downloaded 4.4 MB
package ‘ggmap’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
my path
> library(ggmap)
Error: package or namespace load failed for ‘ggmap’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘maps’
It used to work, then I don't know what happened and it stopped working. Any ideas ? I tried removing the package then installing it again but it still doesn't work
Next time when installing packages, try this:
install.packages("ggmap",dependencies=TRUE)
library(ggmap)
The extra argument will make sure all the necessary dependencies are also installed.

R install package caret [duplicate]

I am trying to load ggplot2. I am using Windows 7. R tells me that ggplot2 has loaded successfully but when I try to use the library function it says it cannot find ggplot2. Here is what it says.
install.packages("ggplot2")
Installing package into ‘C:/Users/Owner/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.1/ggplot2_1.0.0.zip'
Content type 'application/zip' length 2675581 bytes (2.6 Mb)
opened URL
downloaded 2.6 Mb
package ‘ggplot2’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\Owner\AppData\Local\Temp\RtmpyesS1j\downloaded_packages
I then tried to use the library function and got this message:
library("ggplot2")
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
there is no package called ‘munsell’
Error: package or namespace load failed for ‘ggplot2’
> head(diamonds)
Error in head(diamonds) : object 'diamonds' not found
I hope someone has an idea about what I have done wrong.
You should have executed this:
install.packages("ggplot2", dependencies=TRUE)

Resources