I'm trying to handle NULL values using case_when, so that a value is returned when the value is null, otherwise, the object is returned as-is
h <- NULL
dplyr::case_when(
is_empty(h) ~ "This is null",
T ~ h)
> Error in value[[i]] : subscript out of bounds
I don't understand why the error: shouldn't the case_when just output "This is null" and stop there?