zoukankan      html  css  js  c++  java
  • 使用Dockerfile安装R语言镜像

    Dockerfile:

    FROM centos7
    
    WORKDIR /opt/mids/
    
    COPY Miniconda3-latest-Linux-x86_64.sh .
    
    RUN sh Miniconda3-latest-Linux-x86_64.sh -b -p /opt/mids/R && 
      /opt/mids/R/bin/conda init
    
    RUN /opt/mids/R/bin/conda clean -y -a && 
      rm -f Miniconda3-latest-Linux-x86_64.sh
    
    ENV PATH=/opt/mids/R/bin:$PATH 
        LANG=en_US.UTF-8
    
    RUN conda install -y R && 
      conda install -y r-rjson && 
      conda install -y r-rserve && 
      conda install -y r-ggplot2 && 
      conda install -y r-stringi && 
      conda install -y r-rjava && 
      conda install -y r-matrix && 
      conda install -y r-forecast
    RUN  conda clean -y -a
    
    COPY Rserve.r /opt/mids/R/bin/
    
    VOLUME /opt/mids/R
    
    

    其中,LANG=en_US.UTF-8解决R脚本中有中文导致编码异常问题。

    进入R异常:

    'help.start()' for an HTML browser interface to help.
    Type 'q()' to quit R.
    
    Error: package or namespace load failed for 'utils':
     .onLoad failed in loadNamespace() for 'utils', details:
      call: system(paste(which, shQuote(names[i])), intern = TRUE, ignore.stderr = TRUE)
      error: error in running command
    Error: package or namespace load failed for 'stats':
     .onLoad failed in loadNamespace() for 'utils', details:
      call: system(paste(which, shQuote(names[i])), intern = TRUE, ignore.stderr = TRUE)
      error: error in running command
    During startup - Warning messages:
    1: package 'utils' in options("defaultPackages") was not found
    2: package 'stats' in options("defaultPackages") was not found
    
    

    解决方案:

    You're missing "which" I think.

    In this code chunk system(paste(which, shQuote(names[i])), intern = TRUE, ignore.stderr = TRUE), which is an object from Sys.which and its value is the string "/usr/bin/which".

    You should try installing which.

  • 相关阅读:
    Centos 设置开机进图形界面/终端
    Ubuntu 开机慢(networking.service导致)
    Linux 内核下载地址
    C/C++中内存对齐
    编译器数据模型
    CPU中断
    sql语句
    mysql学习
    Active进阶
    SpringBoot整合ActiveMQ
  • 原文地址:https://www.cnblogs.com/flowerbirds/p/14191783.html
Copyright © 2011-2022 走看看