How to set NA for Date Column with case_when

When you create a date column based on a condition with case_when, sometimes you want to set NA as a default.
To do so, you can create a Mutate step like this.

The below example creates a new Date column and set today’s date when the country is Argentina and NA for other countries.

case_when(country  == "Argentina" ~ today(), TRUE ~ as.Date(NA))