1
Q
更改R中的目录
A
回答
3
setwd('path')
只要坚持路径,你就大功告成了。
0
R setwd相当于shell cd。如果你有3个子目录(DIRA,DIRB和DIRC),你想你需要编写如下代码目录内的一些工作:
dirs=c("dirA", "dirB", "dirC") # normally you get these by some means
# not through hard-coding; here is for example only
pwd <- getwd()
for (d in dirs) {
setwd(d)
# do some work in the subdirectory
setwd(pwd) # return to parent directory
}
相关问题
- 1. 更改目录
- 2. 更改目录
- 3. 更改目录
- 4. 更改HIVE中的目标目录
- 5. 在Python中更改目录
- 6. 在pthread中更改目录
- 7. htaccess更改目录
- 8. 更改目录ftpwebrequest
- 9. GetOpenFileName更改目录
- 10. .htaccess更改目录
- 11. 更改中的R
- 12. 更改HttpPostedFileBase.SaveAs目标目录
- 13. 更改cmake的目录
- 14. 更改JFileChooser的目录
- 15. 更改父shell的目录
- 16. 如何更改R CMD Sweave的输出目录?
- 17. 更改我的目录中列出的目录的颜色
- 18. PHP目录更改到根目录
- 19. 批量更改目录到新目录
- 20. 更改监视目录和子目录
- 21. MATLAB聆听目录中的更改
- 22. 英特尔Fortran中的更改目录
- 23. 如何更改linux中gnuplot的目录?
- 24. 检测目录中的更改
- 25. 更改apache中的web根目录(xampp)
- 26. 如何更改Gradle中的libs目录?
- 27. 更改vsftpd中的默认ftp目录
- 28. 更改Google glog中的日志目录
- 29. 更改Electron中的PouchDB目录
- 30. 如何更改ASP.Net中的“App_Themes”目录?
这是否永久地改变工作目录? – radiobrain77
不,这不是永久的。如果需要,您可以再次更改目录 - 即使在同一个会话中。 – Whitebeard