Skip to contents

Facebook mobility data is reported daily at 3 different hours (0, 8, 16). This function reads the data extracted from the current files and detects if any file for a particular day or hour is missing.

Usage

missing_combinations(data)

Arguments

data

A data.frame with a day and hour column.

Value

A data.frame with the missing days and hours, if any.

Examples


# Sample dataset
data <- data.frame(
  country = c("US", "MX", "MX"), 
  day = c("2023-01-01", "2023-01-03", "2023-01-05"),
  hour = c(0, 8, 16)
)

missing_combinations(data)
#>           day hour
#> 1  2023-01-02    0
#> 2  2023-01-03    0
#> 3  2023-01-04    0
#> 4  2023-01-05    0
#> 5  2023-01-01    8
#> 6  2023-01-02    8
#> 7  2023-01-04    8
#> 8  2023-01-05    8
#> 9  2023-01-01   16
#> 10 2023-01-02   16
#> 11 2023-01-03   16
#> 12 2023-01-04   16