kindle可以看pdf:科学网—running R script

来源:百度文库 编辑:中财网 时间:2024/04/29 02:15:22

running R script

已有 188 次阅读 2011-6-23 21:55|个人分类:R语言|系统分类:科研笔记

You can run R script in following ways:
cliffgao

(1)  open R console and type:
source("my.code.R“)

(2) in command line  or in bash:

add
"#!/usr/bin/env Rscript"
in the first line of  "my.code.R"
$ Rscript  my.code.R

or
chmod +x my.code.R
./my.code.R


(3)   in BATCH mode

$ R CMD BATCH  my.code.R

(4) See more in
http://manuals.bioinformatics.ucr.edu/home/programming-in-r