Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/75.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用purrr从嵌套的TIBLE中写入具有多个工作表名的excel工作表_R_Purrr_Tibble - Fatal编程技术网

使用purrr从嵌套的TIBLE中写入具有多个工作表名的excel工作表

使用purrr从嵌套的TIBLE中写入具有多个工作表名的excel工作表,r,purrr,tibble,R,Purrr,Tibble,如何使用purrr将多个excel工作表从嵌套的TIBLE中写入一个excel文件 嵌套的TIBLE如下所示: # A tibble: 3 x 2 sheetName data <chr> <list> 1 Sheet1 <tibble [4 x 2]> 2 Sheet2 <tibble [4 x 2]> 3 Sheet3 <tibble [4 x 2]>

如何使用purrr将多个excel工作表从嵌套的TIBLE中写入一个excel文件
嵌套的TIBLE如下所示:

# A tibble: 3 x 2
  sheetName data            
  <chr>     <list>          
1 Sheet1    <tibble [4 x 2]>
2 Sheet2    <tibble [4 x 2]>
3 Sheet3    <tibble [4 x 2]>
#一个tible:3 x 2
图纸名称数据
1张1
2张图2
3张图3

谢谢你的帮助

创建数据帧的命名列表,并将其与
openxlsx
writexl
包一起使用

openxlsx::write.xlsx(setNames(df$data, df$sheetName), 'temp.xlsx')

writexl::write_xlsx(setNames(df$data, df$sheetName), 'temp1.xlsx')