Skip to content

Installing packages #196

Open
Open

Description

@MortenRisstad

Hi all

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

Thanks in advance for any helpful suggestions.

Regards
Morten

Activity

  1. vsin420 commented on Dec 23, 2020

    @vsin420

    Hi, I'm having similar problems with ggplot2:

    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

    installing the source package 'ggplot2'

    trying URL 'https://mirror.niser.ac.in/cran/src/contrib/ggplot2_3.3.2.tar.gz'
    Content type 'application/x-gzip' length 3054431 bytes (2.9 MB)
    downloaded 2.9 MB

    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.

    Regards,
    Varun

  2. vsin420 commented on Jan 9, 2021

    @vsin420

    Hi, the following worked for me:

    1. Install RTools to be able to install packages from source
    2. Point Bert to local version of 3.5.3 (3.6 & above don't work for now) by changing preferences (directions on github somewhere)
    3. Make sure R can write to local version of R folder otherwise it will put the packages in personal library
    4. Install required package install.packages("ChainLadder",dependencies=TRUE,type="source") using local version of R (or Bert if you prefer)
    5. 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...

  3. Ljupch0 commented on Mar 13, 2021

    @Ljupch0

    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:

    local({r <- getOption("repos")
           r["CRAN"] <- "https://cran.microsoft.com/snapshot/2019-04-15/" 
           options(repos=r)
    })
    

    You only have packages from April 2019, but they install without problems.

  4. ChronoArkangelus commented on Apr 1, 2021

    @ChronoArkangelus

    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.

  5. StatsMan1953 commented on Feb 12, 2022

    @StatsMan1953

    Have you tried

    install.packages("ggplot2", .Library, repos="https://cran.r-project.org",method="wininet")

  6. bro-bert commented on Dec 2, 2023

    @bro-bert

    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)
    })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions