1. Learn
  2. /
  3. Courses
  4. /
  5. Parallel Programming in R

Exercise

Furrr type specification

You wish to do a masters in engineering and you want to apply to universities in USA. You'd like to go to a university that has a good academic reputation.

You have sourced a dataset of university scores, available to you as a data frame uni_data. The data frame has a column total_score containing engineering academic scores (out of 100) for each university in USA. You would like to create a column called criteria that takes the string value "Pass" for any university that has a total_score above 80, or else "Fail". If a score is missing the value should be NA.

You have criterion_function() in your workspace. You plan to apply this function to total_score using an appropriate future_map() variant. The packages parallel and furrr have been loaded for you.

Instructions

100 XP
  • Plan a multisession and use all available cores except two.
  • Create a new column using the correct future_map() variant to map criterion_function() to the column total_score.
  • Revert to a sequential plan.