idekerlab/llm_evaluation_for_gene_set_interpretation

Problem with running R_requirements.R

Opened this issue · 0 comments

When i try to run Rscript R_requirements.R, i get this error

Error in contrib.url(repos, type) :
  trying to use CRAN without setting a mirror
Calls: install.packages -> startsWith -> contrib.url
Execution halted

I got it fixed by adding this line
options(repos = c(CRAN = "https://cloud.r-project.org"))
Making the script R_requirements.R like this

options(repos = c(CRAN = "https://cloud.r-project.org"))
list.of.packages <- c("plyr", "tidyverse", "readxl", "ggpubr",
"rcompanion", "caret", "ggthemes", "gridExtra", "extrafont", "ggrepel", "stringr")
new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])]
if(length(new.packages)) install.packages(new.packages )

This worked fine.