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. 在Python中更改目錄
- 5. htaccess更改目錄
- 6. GetOpenFileName更改目錄
- 7. 更改中的R
- 8. 更改父shell的目錄
- 9. 更改JFileChooser的目錄
- 10. 如何更改R CMD Sweave的輸出目錄?
- 11. 更改監視目錄和子目錄
- 12. 批量更改目錄到新目錄
- 13. 更改Electron中的PouchDB目錄
- 14. 如何更改linux中gnuplot的目錄?
- 15. 如何更改ASP.Net中的「App_Themes」目錄?
- 16. 檢測目錄中的更改
- 17. 如何更改Bash中的目錄
- 18. 無法更改virtualenv中的目錄django
- 19. 更改Mercurial中的目錄結構
- 20. 更改Xcode中的工作目錄
- 21. 更改apache中的web根目錄(xampp)
- 22. 更改wix中的默認目錄
- 23. 更改R CMD的目標版本
- 24. 更改SBT項目的目錄佈局
- 25. 更改nb項目的webapp目錄
- 26. Qt Creator的項目更改目錄
- 27. 如何更改R Markdown HTML文檔中的目錄的顏色和屬性?
- 28. 更改緩存目錄WebStorm
- 29. 更改UFT工作目錄
- 30. 更改PHP備份目錄
這是否永久地改變工作目錄? – radiobrain77
不,這不是永久的。如果需要,您可以再次更改目錄 - 即使在同一個會話中。 – Whitebeard