You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a recurring issue with installing R-packages and using them in BERT functions. Below is one example; segMGarch works at my local R installation, but BERT will not install it.
Warning messages:
1: In install.packages(c("segMGarch")) :
installation of package 'gss' had non-zero exit status
2: In install.packages(c("segMGarch")) :
installation of package 'Rcpp' had non-zero exit status
3: In install.packages(c("segMGarch")) :
installation of package 'mvtnorm' had non-zero exit status
Error: package or namespace load failed for 'segMGarch' in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
there is no package called 'Rcpp'
In addition: Warning message:
package 'segMGarch' was built under R version 3.5.3
install.packages("ggplot2")
Installing package into 'C:/Users/vsinhaadm/AppData/Local/BERT2/lib'
(as 'lib' is unspecified)
--- Please select a CRAN mirror for use in this session ---
There is a binary version available but the source version is later:
binary source needs_compilation
ggplot2 3.3.0 3.3.2 FALSE
The downloaded source packages are in
'C:\Users\vsinhaadm\AppData\Local\Temp\3\RtmpC6WTj4\downloaded_packages'
Warning message:
In install.packages("ggplot2") :
installation of package 'ggplot2' had non-zero exit status
I'd really appreciate some help here. I have tried dependencies = TRUE & I have tried installing dependent packages similarly but keep running into non-zero exit status error. Thanks.
Install RTools to be able to install packages from source
Point Bert to local version of 3.5.3 (3.6 & above don't work for now) by changing preferences (directions on github somewhere)
Make sure R can write to local version of R folder otherwise it will put the packages in personal library
Install required package install.packages("ChainLadder",dependencies=TRUE,type="source") using local version of R (or Bert if you prefer)
I got an error that one package could not be installed from source. I installed the missing package using binary. I installed the rest from source. Seemed to do the trick for now.
Hope it helps. I guess the error was ultimately because the package to be installed requires latest versions of other packages which we can only get in an older version of R by compiling from source...
Activity
vsin420 commentedon Dec 23, 2020
Hi, I'm having similar problems with ggplot2:
I'd really appreciate some help here. I have tried dependencies = TRUE & I have tried installing dependent packages similarly but keep running into non-zero exit status error. Thanks.
Regards,
Varun
vsin420 commentedon Jan 9, 2021
Hi, the following worked for me:
Hope it helps. I guess the error was ultimately because the package to be installed requires latest versions of other packages which we can only get in an older version of R by compiling from source...
Ljupch0 commentedon Mar 13, 2021
Hi, I found this solution much easier: Set the CRAN to be a MRAN snapshot from when version 3.5.x was the latest. I set this code in the functions.R:
You only have packages from April 2019, but they install without problems.
ChronoArkangelus commentedon Apr 1, 2021
I had the same problem, I need ggplot2 for Excel's reports and Bert don't let me install it.
EDIT: Thanks, Ljupch0, that works for me.
StatsMan1953 commentedon Feb 12, 2022
Have you tried
install.packages("ggplot2", .Library, repos="https://cran.r-project.org",method="wininet")
bro-bert commentedon Dec 2, 2023
MRAN does not work for installations anymore.
You can use the solution below instead reproduced from
https://posit.co/blog/migrating-from-mran-to-posit-package-manager/
local({
r <- getOption("repos")
r["CRAN"] <- "https://packagemanager.posit.co/cran/2022-05-04/"
options(repos=r)
})