pbaylis / website

Source code for https://www.patrickbaylis.com
https://www.patrickbaylis.com
GNU General Public License v3.0
3 stars 2 forks source link

Question Post "Making LaTeX tables that look nice (2024 update)" #4

Closed Artaraz closed 5 months ago

Artaraz commented 5 months ago

hola! I've just tried your code in your last great post "Making LaTeX tables that look nice (2024 update)". I get an error within the part: datasummary_df( summary_stats, output = "latex_tabular" ) %>% group_rows("Variables", start_row = 1, end_row = nrow(variable_distributions), bold = F, italic = T) %>% group_rows("Counts", start_row = nrow(variable_distributions) + 1, end_row = nrow(summary_stats), bold = F, italic = T) %>% write_lines("summary-stats.tex") , the error being:"Error in if (kable_format %in% c("pipe", "markdown")) {: argument id of legth zero", I have the latest version of R and the packages involved. The problem is that : datasummary_df( summary_stats, output = "latex_tabular" ) has no attribute called "format" or at least not for my configuration. I was wondering if you knew which R ,modelsummary, and kableExtra version you had when you run the code (Considering the post date It seems that not so long ago). I don't know if this is the right place to ask, but I couldn't find a "comment" section in the post, it it's not I will delete it. Thank you :)

pbaylis commented 5 months ago

Hi, here's my sessionInfo:

> sessionInfo()
R version 4.3.2 (2023-10-31)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Sonoma 14.4.1

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: America/Los_Angeles
tzcode source: internal

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

other attached packages:
[1] kableExtra_1.4.0   modelsummary_1.4.5

loaded via a namespace (and not attached):
 [1] gtable_0.3.4      dplyr_1.1.4       compiler_4.3.2    tidyselect_1.2.1  xml2_1.3.6       
 [6] stringr_1.5.1     systemfonts_1.0.5 scales_1.3.0      fastmap_1.1.1     ggplot2_3.5.0    
[11] R6_2.5.1          tables_0.9.17     generics_0.1.3    knitr_1.45        tibble_3.2.1     
[16] insight_0.19.7    munsell_0.5.0     svglite_2.1.3     pillar_1.9.0      rlang_1.1.3      
[21] utf8_1.2.4        stringi_1.8.3     xfun_0.41         viridisLite_0.4.2 cli_3.6.2        
[26] magrittr_2.0.3    digest_0.6.33     grid_4.3.2        rstudioapi_0.15.0 cowplot_1.1.3    
[31] lifecycle_1.0.4   vctrs_0.6.5       evaluate_0.23     glue_1.7.0        fansi_1.0.6      
[36] colorspace_2.1-0  pacman_0.5.1      rmarkdown_2.25    tools_4.3.2       pkgconfig_2.0.3  
[41] htmltools_0.5.7  

Good luck!