zoukankan      html  css  js  c++  java
  • 命令行使用(调用) R 或 Bioconductor 脚本

    windows下命令行调用R脚本
     
    1、将R.exe所在路径加到环境变量path下,路径一般为C:Program FilesRR-3.0.1in

    2、在windows 命令行中敲入 调用命令:r CMD BATCH D:RWORKSPACECMD_TEST.R  (注意 CMD BATCH 都要大写)

    命令的普遍形式为R CMD command file,command是别的工具,比如前面用到的批处理工具BATCH

    ------------------
    在Linux命令行中调用R函数

    直接从 Linux命令行调用R函数而不进入R环境?
    解决方法
    一个简单的内置是以下BASH命令:

        export NUM=10
        R -q -e "rnorm($NUM)"

     
    ------------------
    ①Linux下直接执行R命令
     R -e "with(mtcars, {summary(mpg, disp, wt)})"
     即通过“ R -e 'R command' ”的形式。
     
    ②Linux下执行R脚本
     R --no-save < terminalR.R
     
    ③Linux下静默执行R脚本
    R --no-save -q < terminalR.R
    R --no-save --slave < terminalR.R

    ④Windows DOS环境

    脚本的执行需要借助R安装自带的“Rscript”程序。

    # R命令
        cd C:Program FilesRR-3.4.0in
        Rscript -e "with(mtcars, {summary(mpg, disp, wt)})"
    # R脚本
        "C:Program FilesRR-3.4.0inR.exe" --no-save --slave < D:R erminalR.R

    ------------------

    linux命令行下使用R语言绘图

    https://www.cnblogs.com/solohac/p/4154148.html
    ------------------

    REF

    https://blog.csdn.net/sweeper_freedoman/article/details/71438348
    https://blog.csdn.net/diyiziran/article/details/21379181


  • 相关阅读:
    java设计模式概述
    Filter
    hello1 hello2 代码分析
    计划
    页面生命周期1
    Jquery
    关于DropDownList
    页面生命周期
    随机生成验证码
    关于技术
  • 原文地址:https://www.cnblogs.com/emanlee/p/13900239.html
Copyright © 2011-2022 走看看