I got this piece of code:
tel = data.frame(s = c(1,2,3))
tel <- tel %>% mutate(datum = as.Date("19001212", "%Y%m%d"))
tel <- tel %>% mutate(datum = ifelse(s == 1, as.Date("20191211", "%Y%m%d"), datum))
When this code runs it adds a column datum containing the date to a data frame on line 2. Then on line 3 it tries to change this date for rows in which s has the value 1. However for some reason it does not insert the new date in the but the number 18241 and changes all other datum fields (for the other rows into -25222.
What causes this and how do I fix it so it overrides the data set correctly?