永久修改R语言工作目录
来源:互联网 发布:java 网校 源码 编辑:程序博客网 时间:2024/05/16 08:06
默认情况下R语言工作目录每次启动都需要重新设定,为了省事,我们可以把它用命令方式写入到配置文件中,这样每次启动时可以自动设置。
具体方法:
Setting the working directory in R permanently
1)The getwd() command gives the current working directory for R.
The setwd(<path>) sets the working directory
2)Locate the Rprofile.site file.
•It should be in C:\Program Files\R\R-<version>\etc\Rprofile.site (onWindows).•
I’m not sure where this is on a Mac
3)Add setwd(<path>) to the end of theRprofile.sitefile
•Open the Rprofile.site file on text editor (notepad)
•Add the line below to the end of the
找到这个文件 Rprofile.sitefile 文件最后增加新行,然后输入
setwd("<the desired working directory>") //关键是 这一行。
重新打开R就OK
•My Rprofile.sitefilelooks like this:
# Things you might want to change
# options(papersize="a4")
# options(editor="notepad")
# options(pager="internal")
# set the default help type
# options(help_type="text")
options(help_type="html")
# set a site library
# .Library.site <-file.path(chartr("\\", "/", R.home()),"site-library")
# set a CRAN mirror
# local({r <-getOption("repos")
# r["CRAN"] <-"http://my.local.cran"# options(repos=r)})
setwd("C:\\Programming\\R\\Data\\RegressionClassData")
•NOTICE THE EXTRA EMPTY LINE AFTER THE setwd() COMMAND.
•Save and close this file
•Restart the R GUI
•Typing getwd() on the command line shouldnowreturn the path that wasset in the previous steps.
- 永久修改R语言工作目录
- 设置R语言默认工作目录
- [R语言学习记录]-R脚本示例-指定运行工作目录
- R语言-目录操作
- MyEclipse 修改工作目录
- 【R】R语言指定包安装目录
- 修改linux当前工作目录
- hudson修改工作空间目录
- Python修改当前工作目录
- Jenkins 修改端口、工作目录
- xcode 修改默认工作目录
- C获取当前工作目录 修改当前工作目录
- R语言工作区间及相关操作
- R语言设置当前工作文件夹
- R极简教程-4:R语言工作空间
- 修改Eclipse的默认工作目录
- Maven修改nexus的工作目录
- linux maven伺服器nexus工作目录修改
- error while loading shared libraries: libfreebl3.so: wrong ELF class: ELFCLASS64
- 国产龙芯笔记本(on 龙芯2F)的使用体验
- How to compute the square root of an integer?
- 【珍藏】JAVA EE 热门精品资源集(88个)
- leetcode 133: Insertion Sort List
- 永久修改R语言工作目录
- LeetCode题解:Longest Palindromic Substring
- Solaris下FTP服务配置
- 由《打印九九乘法表,要求只能用一个变量》想到的
- 【黑马程序员】 MyEclipse 快捷键大全,麻麻再也不用担心我打字慢了 --By寻找资拥
- 【色度学】 颜色
- 最朴素的快速排序算法
- LeetCode题解:ZigZag Conversion
- 退役贴