insightsengineering / formatters

A framework for creating listings of raw data that include specialized formatting, headers, footers, referential footnotes, and pagination.
https://insightsengineering.github.io/formatters/
Other
15 stars 6 forks source link

`nlines` function fails when width is narrower than the string #299

Open averissimo opened 2 months ago

averissimo commented 2 months ago

Summary

There's a problem with nlines function initially described here: https://github.com/insightsengineering/rtables/pull/875#issuecomment-2154907466

formatters::nlines("01234567890", max_width = 5)
#> Error in FUN(X[[i]], ...): argument "fontspec" is missing, with no default

Created on 2024-06-10 with reprex v2.1.0

R session info


# R -e "utils::sessionInfo()" output goes here
R version 4.4.0 (2024-04-24)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 24.04 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.12.0 
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.12.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_IE.UTF-8       
 [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_IE.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_IE.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_IE.UTF-8 LC_IDENTIFICATION=C       

time zone: Europe/Berlin
tzcode source: system (glibc)

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

loaded via a namespace (and not attached):
 [1] compiler_4.4.0        BiocManager_1.30.23   backports_1.5.0       fastmap_1.2.0        
 [5] cli_3.6.2             htmltools_0.5.8.1     tools_4.4.0           rstudioapi_0.16.0    
 [9] grid_4.4.0            checkmate_2.3.1       formatters_0.5.7.9001 digest_0.6.35        
[13] lifecycle_1.0.4       rlang_1.1.4           renv_1.0.2           

OS / Environment