w <- structure(list(Station = c(NA, 209, 209, 209, 209, 209, 209,
209, 209, 209), Date = c("", "20150101", "20150102", "20150103",
"20150104", "20150105", "20150106", "20150107", "20150108", "20150109"
), `Windsnelheid (in 0,1 m/s)` = c(NA, 133L, 144L, 95L, 77L,
78L, 67L, 99L, 112L, 143L)), row.names = c(NA, -10L), class = c("tbl_df",
"tbl", "data.frame"))
w[is.na(w)] <- 0
#Wind data omzetten
w$Date <- strptime(w$Date, format = "%Y%m%d")
w$Date_txt_formatted <- as.character.Date(w$Date, format = "%m-%d-%Y")
#if you want rid of rows with NA
w2 <- na.omit(w)
the principle to follow is that when you want to present to the user a customised view of a date field, to render that field as text with the required formatting applied, keep the true date field around to calculate on, you don't have to show it to the users if you dont want to.