I am trying to build a docker image with R, and I'd like to be able to break out my package install steps in a clean, easy to read, manner across multiple lines, but bash does not seem to like the approach due to not knowing where the ending ) is.
Is there a way to make this long line of code split across multiple lines?
Rscript -e 'devtools::install_cran(c("tidytext","janitor","corrr","officer","devtools","pacman"))'
To maybe, something like this:
Rscript -e 'devtools::install_cran(c("tidytext","janitor",
"corrr","officer","devtools","pacman"))'
Is this possible to do with Rscript? I have tried using a \ at the end of each line, and it still does not work.
I understand install2.r can list out the packages line by line, but I would like to have a vector of packages to pass to devtools::install_cran
if possible. I have seen others simply refer to their R script by simply calling it via Rscript, but I would like to see all my installation steps inside my Dockerfile, and not copy and run an external R script in my container. Thanks for your help.
Rscript test.R