Intermezzo: missing values (3)
Suppose we have a factor variable day
:
## # A tibble: 4 × 2
## day value
## <fct> <dbl>
## 1 Tue 2
## 2 Thu 3
## 3 Fri 1
## 4 Mon 5
## [1] "Mon" "Tue" "Wed" "Thu" "Fri" "Sat" "Sun"
Now you want a wide table including missing values for the absent factor levels.
Does this work?
## # A tibble: 1 × 4
## Tue Thu Fri Mon
## <dbl> <dbl> <dbl> <dbl>
## 1 2 3 1 5
Obviously not.