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

Check all data frames use factors #2

Closed
hadley opened this issue Nov 24, 2014 · 4 comments
Closed

Check all data frames use factors #2

hadley opened this issue Nov 24, 2014 · 4 comments

Comments

@hadley
Copy link
Member

hadley commented Nov 24, 2014

e.g. flights

@nicholasjhorton
Copy link

dest, origin, carrier, and tailnum are defined as chr in the flights table.

But why make them all factors? Why not change the "name" variable in the "airlines" table to character?

@hadley
Copy link
Member Author

hadley commented May 19, 2015

I don't know why I thought this was a good idea anymore :/

@hadley hadley closed this as completed May 19, 2015
@nicholasjhorton
Copy link

Note that the current setup yields a warning (since airlines uses factors) when you run:

require(nycflights13)
sfoflights <- inner_join(filter(flights, dest=="SFO"), airlines)
Joining by: "carrier"
Warning message:
joining character vector and factor, coercing into character vector

@hadley hadley reopened this May 19, 2015
@hadley
Copy link
Member Author

hadley commented May 19, 2015

Oh bummer, thanks for pointing that out.

@hadley hadley closed this as completed in b03616a Dec 31, 2015
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

2 participants