tomwenseleers / export

R package for streamlined export of graphs and data tables.
192 stars 35 forks source link

Error with table2 export #39

Closed odenipinedo closed 2 years ago

odenipinedo commented 3 years ago

When attempting to export a table/dataframe to PPT or DOC (table2ppt or table2doc), I receive this error:

Error in colformat_num(x = tab, j = col.other, digits = digits) : unused argument (digits = digits)

It has worked in the past, I have recently updated my packages.

Reproducible example(s):

a = c(1,2,3,4,5,6)
b = c("a", "b", "c", "d", "e", "f")
x = data.frame(a, b)
table2doc(x=x)

or

a = c(1,2,3,4,5,6)
b = c("a", "b", "c", "d", "e", "f")
x = table(data.frame(a, b))
table2doc(x=x)

Results in the same error.

See sessionInfo() below:

R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

Matrix products: default

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

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

other attached packages:
 [1] gdtools_0.2.3  tidyr_1.1.2    scales_1.1.1   ggplot2_3.3.3 
 [5] knitr_1.31     export_0.3.0   stringr_1.4.0  dplyr_1.0.4   
 [9] readxl_1.3.1   extrafont_0.17

loaded via a namespace (and not attached):
 [1] fs_1.5.0                usethis_2.0.1          
 [3] devtools_2.3.2          webshot_0.5.2          
 [5] rprojroot_2.0.2         tools_4.0.3            
 [7] backports_1.2.1         utf8_1.1.4             
 [9] R6_2.5.0                DBI_1.1.1              
[11] colorspace_2.0-0        manipulateWidget_0.10.1
[13] withr_2.4.1             tidyselect_1.1.0       
[15] prettyunits_1.1.1       processx_3.4.5         
[17] curl_4.3                compiler_4.0.3         
[19] extrafontdb_1.0         cli_2.3.1              
[21] flextable_0.6.3         xml2_1.3.2             
[23] desc_1.2.0              officer_0.3.16         
[25] labeling_0.4.2          callr_3.5.1            
[27] systemfonts_1.0.1       digest_0.6.27          
[29] rmarkdown_2.7.2         base64enc_0.1-3        
[31] pkgconfig_2.0.3         htmltools_0.5.1.1      
[33] sessioninfo_1.1.1       fastmap_1.1.0          
[35] highr_0.8               rvg_0.2.5              
[37] htmlwidgets_1.5.3       rlang_0.4.10           
[39] rstudioapi_0.13         shiny_1.6.0            
[41] farver_2.0.3            generics_0.1.0         
[43] jsonlite_1.7.2          crosstalk_1.1.1        
[45] zip_2.1.1               magrittr_2.0.1         
[47] Rcpp_1.0.6              munsell_0.5.0          
[49] fansi_0.4.2             lifecycle_1.0.0        
[51] stringi_1.5.3           yaml_2.2.1             
[53] pkgbuild_1.2.0          grid_4.0.3             
[55] promises_1.2.0.1        forcats_0.5.1          
[57] crayon_1.4.1            miniUI_0.1.1.1         
[59] stargazer_5.2.2         ps_1.5.0               
[61] pillar_1.5.0            igraph_1.2.6           
[63] uuid_0.1-4              pkgload_1.2.0          
[65] glue_1.4.2              evaluate_0.14          
[67] data.table_1.14.0       remotes_2.2.0          
[69] vctrs_0.3.6             httpuv_1.5.5           
[71] testthat_3.0.2          Rttf2pt1_1.3.8         
[73] cellranger_1.1.0        gtable_0.3.0           
[75] purrr_0.3.4             assertthat_0.2.1       
[77] cachem_1.0.4            xfun_0.21              
[79] openxlsx_4.2.3          mime_0.10              
[81] hablar_0.3.0            xtable_1.8-4           
[83] broom_0.7.5             later_1.1.0.1          
[85] tibble_3.1.0            memoise_2.0.0          
[87] rgl_0.105.13            ellipsis_0.3.1         
[89] devEMF_4.0-2
cvanderaa commented 3 years ago

Hi @odenipinedo , Thanks for catching this and for the reproducible example! I will have a look at it and keep you informed when this is fixed.

cvanderaa commented 3 years ago

Thanks for noticing this ugly bug! This should be solved now by 1afc8e2. Could you confirm it now works for you?