【问题标题】:Huxtable package for R: How to correctly reference huxtables in bookdown when outputting to WordR 的 Huxtable 包:输出到 Word 时如何正确引用 bookdown 中的 huxtables
【发布时间】:2020-08-05 16:41:18
【问题描述】:

Using the example here,只要我输出为 pdf,我就可以使用 huxtable 和 bookdown 创建一个表并引用它。这似乎不适用于 MS word。

这是我的 sessionInfo,以防万一:

R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default

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

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

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.4.6       compiler_3.6.1     pillar_1.4.2       prettyunits_1.0.2 
 [5] tools_3.6.1        digest_0.6.25      packrat_0.5.0      pkgbuild_1.0.6    
 [9] lifecycle_0.2.0    evaluate_0.14      tibble_2.1.3       gtable_0.3.0      
[13] pkgconfig_2.0.3    rlang_0.4.6        cli_2.0.2          rstudioapi_0.11   
[17] parallel_3.6.1     yaml_2.2.0         xfun_0.10          loo_2.1.0         
[21] gridExtra_2.3      dplyr_1.0.0        knitr_1.28         generics_0.0.2    
[25] vctrs_0.3.1        tidyselect_1.1.0   stats4_3.6.1       grid_3.6.1        
[29] glue_1.4.1         inline_0.3.15      R6_2.4.0           processx_3.4.1    
[33] fansi_0.4.0        rmarkdown_2.3      bookdown_0.20      rstan_2.19.2      
[37] purrr_0.3.3        callr_3.4.3        ggplot2_3.3.1      magrittr_1.5      
[41] matrixStats_0.55.0 scales_1.0.0       ps_1.3.0           htmltools_0.4.0   
[45] StanHeaders_2.19.0 assertthat_0.2.1   colorspace_1.4-1   munsell_0.5.0     
[49] crayon_1.3.4 

 

【问题讨论】:

    标签: r word bookdown


    【解决方案1】:

    经过额外搜索,找到了herehere两个解决方案。最简单的 解决方案是使用 tab.cap 作为块选项:

    ```{r foo, echo=FALSE, tab.cap="Got it!"}
    hux(a = 1:5, b = 1:5)  
    ```
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-25
      • 2021-10-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多