R:kableExtra包 - 使用kable_as_image()无法将(LaTeX)表保存为图像

时间:2017-09-13 13:18:08

标签: r kableextra

错误讯息: open.connection(path,“wb”)出错:无法打开连接 电话:... kable_as_image - > write_file->打开 - > open.connection执行暂停

使用以下命令编织RMarkdown文件时:

library(knitr)
library(kableExtra)
dt <- mtcars[1:5, 1:6]
options(knitr.table.format = "latex")
kable_as_image(kable_input = kable(dt),filename = "abcd",file_format = 
"png",latex_header_includes = NULL, keep_pdf = FALSE)

工作目录:“C:/ Users / xyz / Documents”

  

sessionInfo()

R version 3.4.1 (2017-06-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_India.1252  LC_CTYPE=English_India.1252   
[3] LC_MONETARY=English_India.1252 LC_NUMERIC=C                  
[5] LC_TIME=English_India.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] kableExtra_0.5.1

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.12         digest_0.6.12        rprojroot_1.2       
 [4] R6_2.2.2             backports_1.1.0      magrittr_1.5        
 [7] evaluate_0.10.1      httr_1.3.0           rlang_0.1.2         
[10] stringi_1.1.5        magick_1.3           xml2_1.1.1          
[13] rmarkdown_1.6.0.9004 tools_3.4.1          stringr_1.2.0       
[16] readr_1.1.1          hms_0.3              yaml_2.1.14         
[19] compiler_3.4.1       rvest_0.3.2          htmltools_0.3.6     
[22] knitr_1.17           tibble_1.3.3   

0 个答案:

没有答案