R语言 重命名目录下所有文件

myfilepath <- "F:/paper2/climateExposure/wjj_mec/second/paths/"

setwd(myfilepath)

alltypefiles = dir(myfilepath)

newname = gsub(pattern = 'paths.',replacement = 'paths_',x = alltypefiles)

file.rename(alltypefiles,newname)

posted @ 2018-11-17 17:12  junjunang  阅读(2538)  评论(0编辑  收藏  举报