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

query about use of factors in the penguins dataset #76

Open
nicholasjhorton opened this issue Aug 2, 2020 · 0 comments
Open

query about use of factors in the penguins dataset #76

nicholasjhorton opened this issue Aug 2, 2020 · 0 comments

Comments

@nicholasjhorton
Copy link

I love the penguins. Thanks for putting this together.

I had one question. Dospecies, island, and sex need to be factors?

As an example of how leaving them as character vectors might be preferable, imagine an analysis that considers penguins on only two island. If dplyr::filter() is used then there's still a stray factor level that needs to be dropped.

Would it be feasible to move to characters in a future release?

suppressPackageStartupMessages(library(dplyr))
library(palmerpenguins)
glimpse(penguins)
#> Rows: 344
#> Columns: 8
#> $ species           <fct> Adelie, Adelie, Adelie, Adelie, Adelie, Adelie, Ade…
#> $ island            <fct> Torgersen, Torgersen, Torgersen, Torgersen, Torgers…
#> $ bill_length_mm    <dbl> 39.1, 39.5, 40.3, NA, 36.7, 39.3, 38.9, 39.2, 34.1,…
#> $ bill_depth_mm     <dbl> 18.7, 17.4, 18.0, NA, 19.3, 20.6, 17.8, 19.6, 18.1,…
#> $ flipper_length_mm <int> 181, 186, 195, NA, 193, 190, 181, 195, 193, 190, 18…
#> $ body_mass_g       <int> 3750, 3800, 3250, NA, 3450, 3650, 3625, 4675, 3475,…
#> $ sex               <fct> male, female, female, NA, female, male, female, mal…
#> $ year              <int> 2007, 2007, 2007, 2007, 2007, 2007, 2007, 2007, 200…

Created on 2020-08-02 by the reprex package (v0.3.0)

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

No branches or pull requests

1 participant