davidgohel / flextable

table farming
https://ardata-fr.github.io/flextable-book/
554 stars 79 forks source link

Error using as_flextable on summarizor object containing only discrete datatype #588

Closed JoHoGH closed 10 months ago

JoHoGH commented 10 months ago

Get error if I use summarizorand then as_flextableon a dataset with only discrete variables

Error in character(length = length(num1)) : object 'value1' not found

dat <- ggplot2::mpg |> 
  select(where(is.character)) |>
  flextable::summarizor()
flextable::as_flextable(dat) 
> sessionInfo()
R version 4.2.3 (2023-03-15 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

Matrix products: default

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

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

loaded via a namespace (and not attached):
 [1] tidyselect_1.2.0        xfun_0.41               colorspace_2.1-0        fontquiver_0.2.1       
 [5] vctrs_0.6.4             generics_0.1.3          htmltools_0.5.7         utf8_1.2.4             
 [9] rlang_1.1.2             later_1.3.1             pillar_1.9.0            withr_2.5.2            
[13] httpcode_0.3.0          glue_1.6.2              gfonts_0.2.0            gdtools_0.3.4          
[17] uuid_1.1-1              lifecycle_1.0.4         munsell_0.5.0           gtable_0.3.4           
[21] ragg_1.2.6              zip_2.3.0               evaluate_0.23           knitr_1.45             
[25] fastmap_1.1.1           httpuv_1.6.12           fontLiberation_0.1.0    curl_5.1.0             
[29] fansi_1.0.5             Rcpp_1.0.11             xtable_1.8-4            openssl_2.1.1          
[33] promises_1.2.1          scales_1.2.1            jsonlite_1.8.7          mime_0.12              
[37] systemfonts_1.0.5       fontBitstreamVera_0.1.1 textshaping_0.3.7       ggplot2_3.4.4          
[41] askpass_1.2.0           digest_0.6.33           dplyr_1.1.3             shiny_1.7.5.1          
[45] grid_4.2.3              cli_3.6.1               tools_4.2.3             magrittr_2.0.3         
[49] tibble_3.2.1            crul_1.4.0              crayon_1.5.2            pkgconfig_2.0.3        
[53] ellipsis_0.3.2          data.table_1.14.8       xml2_1.3.5              rmarkdown_2.25         
[57] officer_0.6.3           flextable_0.9.4         R6_2.5.1                compiler_4.2.3 
davidgohel commented 10 months ago

Thanks, can you try the dev version? It should be fixed now

JoHoGH commented 10 months ago

Thanks, can you try the dev version? It should be fixed now

That worked for me. Thanks!

github-actions[bot] commented 4 months ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.