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

titanic_4 not working #10

Open
Darthpathos opened this issue Jan 8, 2020 · 0 comments
Open

titanic_4 not working #10

Darthpathos opened this issue Jan 8, 2020 · 0 comments

Comments

@Darthpathos
Copy link

Good day
Further to others that have posted here, I am working on the titanic dataset problem #4 and am having the same issue, where the answer I have (from the titanic_4_corrected file here) is not being marked as Correct.

This is the code I am running:

titanic_4 <- titanic %>% 
    select(Survived, Pclass, Age, Sex) %>%
    filter(!is.na(Age)) %>%
    mutate(agecat = cut(Age, breaks = c(0, 14.99, 50, 150), 
                        include.lowest = TRUE,
    labels = c("Under 15", "15 to 50", "Over 50"))) %>%
    group_by(Pclass, agecat, Sex) %>%
    summarize(N = n(),
        survivors = sum(Survived == 1),
        perc_survived = 100 * survivors / N)

which I realized doesn't have the head(titanic_4) line at the end; however, I'm still not able to get it working and am completely stumped.
Any ideas would be appreciated.
Chris

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