setwd("C:/myprojects/project1")
options()
options(digits=3)
x <- runif(20)
summary(x)
hist(x)
savehistory()
save.image()
执行脚本 source(**.R)
将文本输出到指定的文件中使用sink(地址,append=true,split=true)
append 是向指定的文本中追加,否则覆盖
split =true即向屏幕输出也想文件输出
图像的输出要使用不同的函数进行输出
pdf(“***.pdf”)
png(“***.png”)
jpeg(“**.jpeg”)
bmp(“**.bmp”)
具体的应用就是
首先设置然后在执行脚本
sink(“myoutput”,append=true,split=true)
pdf("mygraph.pdf")
source("script.R")