我使用docker命令来安装R包:
RUN R -e "install.packages(c("readxl","zoo","plotly","RcppRoll","shiny","tidyverse"\
,"shinyWidgets","shinythemes","metR","writexl","shinydashboard","lubridate","sjmisc"\
,"DBI","dplyr","dbplyr","odbc"), repos='https://cloud.r-project.org/')"
我得到了错误
安装包(c(readxl,zoo,plotly,RcppRoll,shiny,tidyverse,shinyWidgets,shinythemes,metR,writexl,shinydashboard,lubridate,sjmisc,DBI,dplyr,dbplyr,odbc),repos ="https://cloud.r-project.org/")安装包时出错(c(readxl,zoo,plotly,RcppRoll,shiny,tidyverse,:未找到对象'readxl'执行已停止
错误在哪里?R在没有Docker的情况下运行良好。
1条答案
按热度按时间pw9qyyiw1#
你正在成为shell引用的牺牲品,有时候被称为shell引用地狱。事实上,正如你所说的,“R运行良好,没有docker”只是意味着你在R中有正确的命令,但不是来自shell。
但是(方法1)转义引号有效:
或(方法2)将双引号括在单引号中
所以我会试着
顺便说一句,你可能还想看看r2u,让所有这些都在Ubuntu 22.04或20.04上作为二进制文件(!!)完成。