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

the skim function doesn't give statistics #271

Closed
xiaoouwang opened this issue Dec 11, 2019 · 11 comments
Closed

the skim function doesn't give statistics #271

xiaoouwang opened this issue Dec 11, 2019 · 11 comments
Assignees
Labels
v2 Second edition

Comments

@xiaoouwang
Copy link

I don't know if it's just me but when I run

evals_ch5 <- evals %>%
  select(ID, score, bty_avg, age)
evals_ch5 %>% select(score, bty_avg) %>% skim()

the results show no statistics
image

@ismayc
Copy link
Member

ismayc commented Dec 11, 2019

Hi @xiaoouwang. The summary statistics that we show appear in the lines following the last line that you have in your screenshot:

library(moderndive)
library(tidyverse)
library(skimr) #v2.0.2

evals_ch5 <- evals %>%
  select(ID, score, bty_avg, age)
evals_ch5 %>% select(score, bty_avg) %>% skim()
── Data Summary ────────────────────────
                           Values    
Name                       Piped data
Number of rows             463       
Number of columns          2         
_______________________              
Column type frequency:               
  numeric                  2         
________________________             
Group variables            None      

── Variable type: numeric ─────────────────────────────────────────────────────────────────────────────
  skim_variable n_missing complete_rate  mean    sd    p0   p25   p50   p75  p100 hist 
1 score                 0             1  4.17 0.544  2.3   3.8   4.3    4.6  5    ▁▁▅▇▇
2 bty_avg               0             1  4.42 1.53   1.67  3.17  4.33   5.5  8.17 ▃▇▇▃▂

In the book, we are using a modified version of the output that v1.0.6 of {skimr} produces:

library(moderndive)
library(tidyverse)
# remove.packages("skimr")
# Restart R
# remotes::install_version(package = "skimr", version = "1.0.6")
library(skimr) #v1.0.6

evals_ch5 <- evals %>%
  select(ID, score, bty_avg, age)
evals_ch5 %>% select(score, bty_avg) %>% skim()
Skim summary statistics
 n obs: 463 
 n variables: 2 

── Variable type:numeric ──────────────────────────────────────────────────────────────────────────────
 variable missing complete   n mean   sd   p0  p25  p50 p75 p100     hist
  bty_avg       0      463 463 4.42 1.53 1.67 3.17 4.33 5.5 8.17 ▂▅▅▇▃▃▂▁
    score       0      463 463 4.17 0.54 2.3  3.8  4.3  4.6 5    ▁▁▂▃▅▇▇▆

Hope that helps!

@xiaoouwang
Copy link
Author

Hi @xiaoouwang. The summary statistics that we show appear in the lines following the last line that you have in your screenshot:

library(moderndive)
library(tidyverse)
library(skimr) #v2.0.2

evals_ch5 <- evals %>%
  select(ID, score, bty_avg, age)
evals_ch5 %>% select(score, bty_avg) %>% skim()
── Data Summary ────────────────────────
                           Values    
Name                       Piped data
Number of rows             463       
Number of columns          2         
_______________________              
Column type frequency:               
  numeric                  2         
________________________             
Group variables            None      

── Variable type: numeric ─────────────────────────────────────────────────────────────────────────────
  skim_variable n_missing complete_rate  mean    sd    p0   p25   p50   p75  p100 hist 
1 score                 0             1  4.17 0.544  2.3   3.8   4.3    4.6  5    ▁▁▅▇▇
2 bty_avg               0             1  4.42 1.53   1.67  3.17  4.33   5.5  8.17 ▃▇▇▃▂

In the book, we are using a modified version of the output that v1.0.6 of {skimr} produces:

library(moderndive)
library(tidyverse)
# remove.packages("skimr")
# Restart R
# remotes::install_version(package = "skimr", version = "1.0.6")
library(skimr) #v1.0.6

evals_ch5 <- evals %>%
  select(ID, score, bty_avg, age)
evals_ch5 %>% select(score, bty_avg) %>% skim()
Skim summary statistics
 n obs: 463 
 n variables: 2 

── Variable type:numeric ──────────────────────────────────────────────────────────────────────────────
 variable missing complete   n mean   sd   p0  p25  p50 p75 p100     hist
  bty_avg       0      463 463 4.42 1.53 1.67 3.17 4.33 5.5 8.17 ▂▅▅▇▃▃▂▁
    score       0      463 463 4.17 0.54 2.3  3.8  4.3  4.6 5    ▁▁▂▃▅▇▇▆

Hope that helps!

Hi ismayc I found the solution here : it's due to some problem with the new tibble datatype. Maybe it would be helpful to mention it in the book.

ropensci/skimr#554

@ismayc
Copy link
Member

ismayc commented Dec 17, 2019

Can you confirm that you also see this when you use version 1.0.6?

@xiaoouwang
Copy link
Author

Can you confirm that you also see this when you use version 1.0.6?

Oh i didn't test it on 1.0.6. I've installed with install.Package and it directly installs version 2.x. I think many people will install directly the most recent version too.

@ismayc
Copy link
Member

ismayc commented Dec 17, 2019

Right, but one reason we use version 1.0.6 is problems with version 2.x and above. You can see the other versions of the packages we used at https://moderndive.com/E-appendixE.html. You can install the previous version via

remove.packages("skimr");remotes::install_version(package = "skimr", version = "1.0.6")

@ismayc ismayc closed this as completed Dec 20, 2019
@elinw
Copy link

elinw commented Dec 22, 2019

@ismayc If there is an issue in skimr v2 can you let us know in our tracker? http://github.com/ropensci/skimr.

@ismayc
Copy link
Member

ismayc commented Dec 22, 2019

Unfortunately the issues I brought up in ropensci/skimr#424 were never cleanly resolved for what we were after. We ended up needing to copy-and-paste the modified output in the book to be able to show some of the functionality.

@elinw
Copy link

elinw commented Dec 24, 2019

So is the issue about wrapping or about being able to specify a specific length? I also have issues about bookdown and I will try to look into it.

@ismayc
Copy link
Member

ismayc commented Dec 24, 2019

A little of both. Feel free to play around with either the Chapter 5 or Chapter 6 files so you can see the output.

@elinw
Copy link

elinw commented Feb 6, 2020

Take a look at version 2.1, it may solve the issue. There are new parameters to the print function that allow control of the horizontal rule.

@rudeboybert
Copy link
Member

Thanks for the heads up @elinw, we'll re-open this issue and take a look at v2.1 when we have a moment.

@rudeboybert rudeboybert reopened this Feb 6, 2020
@rudeboybert rudeboybert self-assigned this Feb 16, 2020
@rudeboybert rudeboybert added the v2 Second edition label May 25, 2020
@rudeboybert rudeboybert removed the v2 Second edition label Jun 20, 2020
@rudeboybert rudeboybert added the v2 Second edition label Jul 1, 2020
@ismayc ismayc closed this as completed Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2 Second edition
Projects
None yet
Development

No branches or pull requests

4 participants