Hey I would like to do the following activities with the dataset titanic in tibble form:
Using the %>% operator and functions from dplyr:
-
Select the adult partial dataset,
-
group this subset by class and gender,
-
determine the relative survival frequency in each group and the number of observations per group.
I have already implemented the first two points as followed. However, I am not getting anywhere with the third point. Could someone help me? Thank you!
titanic_tibble <- as_tibble(datasets::Titanic)
titanic_tibble %>%
filter(Age == "Adult") %>%
group_by(Class,Sex) %>%
summarise (n = n())