首页 > 代码库 > R语言 复制文件,复制目录
R语言 复制文件,复制目录
file.info
file.create
dir.create
file.copy
if(!dir.exists("Result_Dir")){ dir.create("Result_Dir") } setwd("Result_Dir") # Folder _ 2 dir.create("2_test", showWarnings = TRUE, recursive = FALSE) if(file.exists("Result.xls")){ file.rename("Result.xls", "2_test/Result.xls" ) } # Folder _ 3 dir.create("4_test/T3_results", showWarnings = TRUE, recursive = TRUE)
参考:
http://astrostatistics.psu.edu/su07/R/html/base/html/files.html
http://stackoverflow.com/questions/10266963/moving-files-between-folders
http://r.789695.n4.nabble.com/copy-directory-command-td881914.html
http://r.789695.n4.nabble.com/copyING-directories-and-files-td960879.html
> list.files(".") [1] "R_plot" "R_test" [3] "result_Annotation.xls" "Rg" [5] "sample.ped" "sample.ped.LD" [7] "sample.ped.LD.PNG" "Tree_plot.txt" [9] "Youku Files" "T_T.py" > file.info("Tree_plot.txt")$isdir [1] FALSE > !isTRUE(file.info("Tree_AT")$isdir) [1] TRUE > file.info("Tree_AT")$isdir
本文出自 “R和Python应用” 博客,请务必保留此出处http://matrix6ro.blog.51cto.com/1746429/1904021
R语言 复制文件,复制目录
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。