R语言常用命令集

1、Window+RStudio更新R版本

载入installR包:    library(installr)
执行更行语句: updateR()

2、中断R语言程序运行

Ctrl+C

3、RStudio中安转Github上的包

1)安转包“devtools”:install.packages("devtools")
 (2)安转github上的包:install_github("*****")

4、查看实例程序

demo(),比如图形演示,输入demo(graphical),

5、获取帮助

help.start()help

6、workspace

1、显示当前的工作目录:getwd()
2、设置成自己所需的目录:setwd("mydir")
3、列出当前workspace的对象:ls()
4、退出R:q()
5、读取一个workspace:load("myfile")

7、输入与输出

1、执行一个脚本:source("filename")
2、输出重定向到文件filename:sink("filename")
3、图形输出:pdf("filename.pdf")png("filename.png")、、、
4、输出返回到终端:dev.off

你可能感兴趣的:(程序开发)