1、
rm(list = ls())
dir()
for (i in list.files(pattern=".r$")) {
source(i)
}
2、
rm(list = ls())
dir()
for (i in dir()) {
if(substr(i,nchar(i)-1,nchar(i)) == ".r"){
source(i)
}
}
标签:函数,批量,list,source,ls,rm,加载,dir,nchar
来源: https://www.cnblogs.com/liujiaxin2018/p/14948087.html