1. Learn
  2. /
  3. Courses
  4. /
  5. Programming with dplyr

Connected

Exercise

Bang bang into the room

You previously used {{ }} from the rlang package in a function definition to pass an unquoted column name to group_by(). This can also be done within summarize(). In this exercise, you'll work with !! and enquo(), but similar code could also be written to use {{ }}. You'll come back to that in the next lesson.

Instructions 1/2

undefined XP
  • 1
    • Make a function with 2 unquoted arguments: a grouping column group_col and one to take the median of. (Don't use {{ }}!)
  • 2
    • Call the function, grouping by region, to calculate median infant_mortality_rate by region.