R语言函数循环导入excel

个股明细批量导入

udf_DT_stock <- function(new_table = stock_day_all ,
source_tb_name = "stock_day_all",
date_init_mark = "20211108",
date_mark_str = date_definite_list){
new_table <- udf_DT(paste0(path_invest,source_tb_name,date_init_mark,".xlsx"))[0] # 数据末班导入
new_table <- new_table[,stock_day:=""]

for (i in (1:length( date_mark_str )) ){ # 导入100日数据
new_table <- rbind(new_table,
cbind(udf_DT(paste0(path_invest,"stock_day_all",date_mark_str[i],".xlsx")),
stock_day= as.character(date_mark_str[i]) ) )
}
return(new_table) # 循环导入
}

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容