Use R CRAN packages within datalore

I want to be able install these packages in my R Notebook: CRAN Packages By Name

However it seems like I am only allowed to install stuff with conda. How would I install the R CRAN repo so i can do install.packages() in my R code?

For instance if I try to install devtools with install.packages(“devtools”) I get this error:
“download of package ‘devtools’ failed”

I think I need to add the CRAN repo in my init.sh but I am not sure how.

For instance I want to install ggVennDiagram using this code:
install.packages(“ggVennDiagram”)

library(“ggVennDiagram”)

however it just runs seemingly for ever

Hi!

Sorry for the late response, we still need to check wether we can improve the performance there, but I managed to install the mentioned packages by manually installing additional dependencies beforehand.

Solution:

Open “Tools → Terminal” and execute conda install -c conda-forge udunits2 gdal there, afterwards you will be able to install install.packages("ggVennDiagram") with no errors.

Detailed explanation:

  • there is an error in the output:

installation of package ‘units’ had non-zero exit status

  • to get the detailed message one have to pass keep_outputs argument:
    install.packages("units", keep_outputs=TRUE)
  • turned out libudunits2-dev is missing, but in this environment it should be installed via conda, otherwise it won’t be discovered: conda install -c conda-forge udunits2
  • sf package from the dependencies is also failing with gdal-dev missing dependency, fixing: conda install -c conda-forge gdal

It seems, both packages should be installed by default - will ask the devs to check & update our envs if needed.

Thank you!