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

Make one sotc3 dataset #10

Open
hadley opened this issue Aug 3, 2015 · 1 comment
Open

Make one sotc3 dataset #10

hadley opened this issue Aug 3, 2015 · 1 comment

Comments

@hadley
Copy link

hadley commented Aug 3, 2015

Is there a reason not to start out like this:

sotc <- bind_rows(sotc10, sotc09, sotc08)
by_year <- sotc %>% group_by(year)

it feels like it would simplify a lot of the code.

@AmeliaMN
Copy link
Member

AmeliaMN commented Aug 5, 2015

Honest reason it is not like that-- I started working on just the 2010 data for ease of use, long before I was aware of dplyr (perhaps before it existed?!).

Reason not to change the code is a combination of laziness and lack of understanding of what bind_rows() does. If I try the line you suggested, I get
Error: incompatible type (data index: 2, column: 'problem_1', was collecting: integer (dplyr::Collecter_Impl<13>), incompatible with data of type: factor In addition: Warning message: In rbind_all(list(x, ...)) : Unequal factor levels: coercing to character

The years are all slightly different in terms of the data they create, so I'm not sure it makes conceptual sense to combine them.

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