ПочатиПочніть безкоштовно

Finding missing observations

You're an inspector at a nuclear plant and have to validate whether every reactor has received its daily safety check over the course of a full year. The safety check logs are in reactor_df, a data frame with columns date, reactor, and check.

Two vectors, dates and reactors, with all dates of the year and reactors at the plant respectively have been created for you. You'll use the combination of the expand_grid() and anti_join() functions to find dates where particular reactors were not checked.

The dplyr package has been pre-loaded for you.

Ця вправа є частиною курсу

Reshaping Data with tidyr

Переглянути курс

Інструкції до вправи

  • Use the expand_grid() function to create a tibble holding all combinations of the variables date and reactor. Use the dates and reactors vectors created for you.
  • Perform an anti-join between full_df and reactor_df on the date and reactor columns.

Інтерактивна практична вправа

Спробуйте виконати цю вправу, доповнивши цей зразок коду.

# Create a tibble with all combinations of dates and reactors
full_df <- ___

# Find the reactor - date combinations not present in reactor_df
full_df %>% 
  ___
Редагувати та запускати код