Exercise 1: Selecting Columns (Variables)
Write the R code required to add select the variables age (age), family history (fam_hx), and tumor stage (t_stage) from the prostate cancer (prostate) dataset:
prostate %>%
select(---,---,---)
prostate %>%
select(age,---,---)
prostate %>%
select(age, fam_hx, t_stage)
Exercise 2: Selecting Columns (Variables)
Write the R code required to add select the baseline Gleason Score and the surgical Gleason score from the prostate dataset. These are variables that end in gs (for Gleason Score), so we can use the ends_with selection helper within the select function. This is a harder example, so use the Hints button prn.
prostate %>%
select(--("--"))
prostate %>%
select(ends_with("--"))
prostate %>%
select(ends_with("gs"))