Session.2 Workspace and Files

2016-11-26  本文已影响0人  Yujen_Chen

Workspace and Files

> args(list.files)
> function (path = ".", pattern = NULL, all.files = FALSE, full.names = FALSE, 
recursive = FALSE, ignore.case = FALSE, include.dirs = FALSE, no.. = FALSE) 
NULL
> dir.create("testdir")
## create a folder under the current workspace under the current worksapce
> file.create("mytest.R")
> file.exists("mytest.R")
> TRUE
> file.info("mytest.R")
>          size isdir mode               mtime               ctime               atime exe
mytest.R    0 FALSE  666 2016-11-25 17:38:43 2016-11-25 17:38:43 2016-11-25 17:38:43  no
> file.rename("mytest.R", "mytest2.R")
> file.copy("mytest2.R", "mytest3.R")
> dir.create(file.path("testdir2", "testdir3"), recursive = TRUE)
## create folder "testdir2" and subfolder "testdir3" in the current workspace with the option "recursive" is TRUE
> unlink("testdir", recursive = TRUE)
上一篇 下一篇

猜你喜欢

热点阅读