Datacamp Machine learning in the tidyverse question

Hi, I am completing an online course in r and am stuck on a question

# Build a linear model for each country using all features
gap_fullmodel <- gap_nested %>% 
  mutate(model = map(data, ~lm(formula = life_expectancy ~., data = .x)))

fullmodel_perf <- gap_fullmodel %>% 
  # Extract the fit statistics of each model into dataframes
  mutate(fit = map(model, ~glimpse(.x))) %>% 
  # Simplify the fit dataframes for each model
  unnest(fit)
  
# View the performance for the four countries with the worst fitting 
# four simple models you looked at before
fullmodel_perf %>% 
  ___(country %in% worst_fit$country) %>% 
  select(country, adj.r.squared)

What command should go on the second last line, before (country %in% worst_fit$country)?

Hard to say because I don't know for sure what is in worst_fit data frame, but I'm assuming it's looking for the function

filter(country %in% worst_fit$country

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.