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)
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)