Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Positron #796

Closed
laurenceomfoisy opened this issue Jul 23, 2024 · 9 comments
Closed

Positron #796

laurenceomfoisy opened this issue Jul 23, 2024 · 9 comments
Labels

Comments

@laurenceomfoisy
Copy link

Unable to use modelsummary() in positron

> df <- mtcars
> m <- lm(mpg ~ gear + hp, data = df)
> modelsummary::modelsummary(m)
Error:
! Function viewer not found in RStudio
Hide Traceback
    ▆
 1. ├─methods (local) `<stndrdGn>`(`<tinytabl[,2]>`)
 2. └─tinytable (local) `<stndrdGn>`(`<tinytabl[,2]>`)
 3.   └─tinytable:::print.tinytable(...)
 4.     └─rstudioapi::viewer(htmlFile)
 5.       └─rstudioapi::callFun("viewer", url, height = height)
@vincentarelbundock
Copy link
Owner

Hey ça roule?

This should be fixed by updating modelsummary and its dependencies (tinytable in particular). You can do this:

modelsummary::update_modelsummary()`

Restart R and try again.

@vincentarelbundock vincentarelbundock changed the title Unable to use modelsummary() in positron Positron Jul 23, 2024
@vincentarelbundock vincentarelbundock pinned this issue Jul 23, 2024
@laurenceomfoisy
Copy link
Author

Oh yeah!

Tout fonctionne 🔥

J'aurais pu penser à updater avant d'ouvrir un issue 🙈

Bonne journée!

@floswald
Copy link

hey folks, doesn't work for me weirdly.

> packageVersion("modelsummary")
[1] ‘2.2.0.4’

Positron Version: 2024.11.0 (Universal) build 140
Code - OSS Version: 1.93.0
Commit: e0d844b031f95acbf89f234a2cce2af9b6721f6c
Date: 2024-10-31T14:24:19.540Z
Electron: 30.4.0
Chromium: 124.0.6367.243
Node.js: 20.15.1
V8: 12.4.254.20-electron.0
OS: Darwin arm64 23.6.0



R version 4.4.2 (2024-10-31)
Platform: aarch64-apple-darwin20
Running under: macOS Sonoma 14.7.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.4-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.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: Europe/Rome
tzcode source: internal

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

other attached packages:
[1] BusLocations_0.0.0.9000

loaded via a namespace (and not attached):
  [1] Rdpack_2.6.1          DBI_1.2.3             gridExtra_2.3         modelsummary_2.2.0.4  formatR_1.14          rlang_1.1.4           magrittr_2.0.3        e1071_1.7-14         
  [9] compiler_4.4.2        systemfonts_1.1.0     vctrs_0.6.5           stringr_1.5.1         pkgconfig_2.0.3       fastmap_1.2.0         backports_1.5.0       utf8_1.2.4           
 [17] ggstance_0.3.7        rmarkdown_2.28        purrr_1.0.2           xfun_0.47             cachem_1.1.0          mlogit_1.1-1          jsonlite_1.8.8        highr_0.11           
 [25] parallel_4.4.2        broom_1.0.6           cluster_2.1.6         R6_2.5.1              bslib_0.8.0           tables_0.9.28         stringi_1.8.4         parallelly_1.38.0    
 [33] car_3.1-2             rpart_4.1.23          jquerylib_0.1.4       lmtest_0.9-40         Rcpp_1.0.13           assertthat_0.2.1      knitr_1.48            future.apply_1.11.2  
 [41] zoo_1.8-12            base64enc_0.1-3       parameters_0.24.0.3   nnet_7.3-19           tidyselect_1.2.1      rstudioapi_0.16.0     abind_1.4-5           codetools_0.2-20     
 [49] listenv_0.9.1         lattice_0.22-6        tibble_3.2.1          withr_3.0.1           bayestestR_0.15.0.3   evaluate_0.24.0       foreign_0.8-87        future_1.34.0        
 [57] lambda.r_1.2.4        sf_1.0-16             futile.logger_1.4.3   units_0.8-5           proxy_0.4-27          xml2_1.3.6            pillar_1.9.0          ggpubr_0.6.0         
 [65] carData_3.0-5         KernSmooth_2.23-24    checkmate_2.3.2       insight_1.0.0.2       plotly_4.10.4         generics_0.1.3        ggplot2_3.5.1         munsell_0.5.1        
 [73] fuzzyjoin_0.1.6       scales_1.3.0          globals_0.16.3        class_7.3-22          glue_1.7.0            Hmisc_5.1-3           lazyeval_0.2.2        tools_4.4.2          
 [81] data.table_1.16.0     ggsignif_0.6.4        grid_4.4.2            tidyr_1.3.1           rbibutils_2.2.16      datawizard_0.13.0.17  colorspace_2.1-1      nlme_3.1-166         
 [89] patchwork_1.2.0       performance_0.12.4.14 htmlTable_2.4.3       Formula_1.2-5         cli_3.6.3             vistime_1.2.4         kableExtra_1.4.0      futile.options_1.0.1 
 [97] fansi_1.0.6           viridisLite_0.4.2     svglite_2.1.3         dplyr_1.1.4           gtable_0.3.5          rstatix_0.7.2         sass_0.4.9            digest_0.6.37        
[105] classInt_0.4-10       ggrepel_0.9.5         htmlwidgets_1.6.4     htmltools_0.5.8.1     lifecycle_1.0.4       httr_1.4.7            statmod_1.5.0         dfidx_0.1-0          
[113] dotwhisker_0.8.2      MASS_7.3-61      

@vincentarelbundock
Copy link
Owner

Try to update tinytable

@floswald
Copy link

no luck...

> library(modelsummary)
> packageVersion("tinytable")
[1] ‘0.6.1.1’
> modelsummary(L)
Error in `x$sizingPolicy`:
! $ operator is invalid for atomic vectors
Hide Traceback
    ▆
 1. ├─base (local) `<fn>`(x)
 2. └─kableExtra:::print.kableExtra(x)
 3.   ├─base::print(html_kable)
 4.   └─print.shiny.tag.list(html_kable)
 5.     └─base::isTRUE(x$sizingPolicy$knitr$figure)

@vincentarelbundock
Copy link
Owner

@floswald looks like you are using kableExtra rather than the default tinytable.

I have zero control over how kableExtra prints tables in Positron. You may want to create a minimal reproducible example using a simple kableExtra table --- without modelsummary --- and report it to their repository.

@floswald
Copy link

hmm...that was not my intention. how can i force this to use tinytable instead? the L above is just a list of models, I did not set any options. thanks !

@vincentarelbundock
Copy link
Owner

You probably set a global option (maybe in .Rprofile) or called config_modelsummary() to change it permanently. You can use config_modelsummary(reset = TRUE) to restore.

@floswald
Copy link

floswald commented Dec 11, 2024

and we're back! Love it. Thanks a ton!
(still couldn't find where that was set, but I'll keep my eyes open...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants