我想根据region_action_selected对象中包含的区域保存几个word文档。下面是脚本:
fileout <- tempfile(fileext = ".docx",paste(region_actions_select,"_rapport_2018_",format(Sys.time(), "%d%m%y_%H%M%S"),sep=""))
setwd("C:/Users/Documents")你能帮帮我吗?
发布于 2019-07-15 21:10:58
我猜你有一个数据帧,它的区域名称如下:
region_action_selected <- data.frame(region = c("USA, Europe, China, Asia"))据我所知,你想写不同的文件,你可以使用这样的东西:
for(p in 1:nrow(region_action_selected)){
filenamenum = paste0("C:/Users/Desktop",region_action_selected$region[p],".docx")
tempfile(file=filenamenum)
}如果您可以使用示例输入和预期输出更新您的问题,我可以提供更多帮助。
https://stackoverflow.com/questions/57039116
复制相似问题