Closed MichalLauer closed 2 years ago
Hi Michal!
Sorry about the issue, but I cannot reproduce it.
It appears that there is a bug around returning an invisible()
value, but I don't really understand it past that.
Does it still appear after updating R or calling update.packages(ask = FALSE)
?
Best wishes, Michael
library(skimr)
skimmed <- skim(mtcars)
print(skimmed, include_summary = FALSE)
#>
#> ── Variable type: numeric ──────────────────────────────────────────────────────
#> skim_variable n_missing complete_rate mean sd p0 p25 p50
#> 1 mpg 0 1 20.1 6.03 10.4 15.4 19.2
#> 2 cyl 0 1 6.19 1.79 4 4 6
#> 3 disp 0 1 231. 124. 71.1 121. 196.
#> 4 hp 0 1 147. 68.6 52 96.5 123
#> 5 drat 0 1 3.60 0.535 2.76 3.08 3.70
#> 6 wt 0 1 3.22 0.978 1.51 2.58 3.32
#> 7 qsec 0 1 17.8 1.79 14.5 16.9 17.7
#> 8 vs 0 1 0.438 0.504 0 0 0
#> 9 am 0 1 0.406 0.499 0 0 0
#> 10 gear 0 1 3.69 0.738 3 3 4
#> 11 carb 0 1 2.81 1.62 1 2 2
#> p75 p100 hist
#> 1 22.8 33.9 ▃▇▅▁▂
#> 2 8 8 ▆▁▃▁▇
#> 3 326 472 ▇▃▃▃▂
#> 4 180 335 ▇▇▆▃▁
#> 5 3.92 4.93 ▇▃▇▅▁
#> 6 3.61 5.42 ▃▃▇▁▂
#> 7 18.9 22.9 ▃▇▇▂▁
#> 8 1 1 ▇▁▁▁▆
#> 9 1 1 ▇▁▁▁▆
#> 10 4 5 ▇▁▆▁▂
#> 11 4 8 ▇▂▅▁▁
Created on 2022-10-18 with reprex v2.0.2
Hi Michael,
I called update.packages(ask = FALSE)
but skimr didn't update.
Strangely, after creating a custom function and ending it with invisible()
, it works now as expected
library(skimr)
#> Warning: package 'skimr' was built under R version 4.2.1
skimmed <- skim(mtcars)
call <- function(x) {
print(x, include_summary = FALSE)
invisible()
}
call(skimmed)
#>
#> ── Variable type: numeric ──────────────────────────────────────────────────────
#> skim_variable n_missing complete_rate mean sd p0 p25 p50
#> 1 mpg 0 1 20.1 6.03 10.4 15.4 19.2
#> 2 cyl 0 1 6.19 1.79 4 4 6
#> 3 disp 0 1 231. 124. 71.1 121. 196.
#> 4 hp 0 1 147. 68.6 52 96.5 123
#> 5 drat 0 1 3.60 0.535 2.76 3.08 3.70
#> 6 wt 0 1 3.22 0.978 1.51 2.58 3.32
#> 7 qsec 0 1 17.8 1.79 14.5 16.9 17.7
#> 8 vs 0 1 0.438 0.504 0 0 0
#> 9 am 0 1 0.406 0.499 0 0 0
#> 10 gear 0 1 3.69 0.738 3 3 4
#> 11 carb 0 1 2.81 1.62 1 2 2
#> p75 p100 hist
#> 1 22.8 33.9 ▃▇▅▁▂
#> 2 8 8 ▆▁▃▁▇
#> 3 326 472 ▇▃▃▃▂
#> 4 180 335 ▇▇▆▃▁
#> 5 3.92 4.93 ▇▃▇▅▁
#> 6 3.61 5.42 ▃▃▇▁▂
#> 7 18.9 22.9 ▃▇▇▂▁
#> 8 1 1 ▇▁▁▁▆
#> 9 1 1 ▇▁▁▁▆
#> 10 4 5 ▇▁▆▁▂
#> 11 4 8 ▇▂▅▁▁
Created on 2022-10-18 with reprex v2.0.2
As the issue is now fixed, I'm closing this thread. Thanks for your help!
Hello,
when I was playing around with skimr, I found out that
print(x, include_summary = FALSE)
returns the table twice. Am I doing something wrong?Reprex and session info:
Created on 2022-10-15 with reprex v2.0.2
Session info
``` r sessionInfo() #> R version 4.2.0 (2022-04-22 ucrt) #> Platform: x86_64-w64-mingw32/x64 (64-bit) #> Running under: Windows 10 x64 (build 19044) #> #> Matrix products: default #> #> locale: #> [1] LC_COLLATE=Czech_Czechia.utf8 LC_CTYPE=Czech_Czechia.utf8 #> [3] LC_MONETARY=Czech_Czechia.utf8 LC_NUMERIC=C #> [5] LC_TIME=Czech_Czechia.utf8 #> #> attached base packages: #> [1] stats graphics grDevices utils datasets methods base #> #> other attached packages: #> [1] skimr_2.1.4 #> #> loaded via a namespace (and not attached): #> [1] pillar_1.8.1 compiler_4.2.0 highr_0.9 base64enc_0.1-3 #> [5] R.methodsS3_1.8.2 R.utils_2.12.0 tools_4.2.0 digest_0.6.29 #> [9] jsonlite_1.8.0 evaluate_0.16 lifecycle_1.0.1 tibble_3.1.8 #> [13] R.cache_0.16.0 pkgconfig_2.0.3 rlang_1.0.4 reprex_2.0.2 #> [17] cli_3.3.0 rstudioapi_0.14 yaml_2.3.5 xfun_0.32 #> [21] fastmap_1.1.0 repr_1.1.4 withr_2.5.0 styler_1.7.0 #> [25] stringr_1.4.0 dplyr_1.0.10 knitr_1.40 generics_0.1.3 #> [29] fs_1.5.2 vctrs_0.4.1 tidyselect_1.1.2 glue_1.6.2 #> [33] R6_2.5.1 fansi_1.0.3 rmarkdown_2.17 tidyr_1.2.0 #> [37] purrr_0.3.4 magrittr_2.0.3 ellipsis_0.3.2 htmltools_0.5.3 #> [41] utf8_1.2.2 stringi_1.7.8 R.oo_1.25.0 ```