I have a data pipeline in R, and stuck with the error of converting a string into date for non-existed date in a future

```
s_date <- "2021-02-29"    
as.Date(s_date, origin = "1970-01-01")

```

This code generates error "Error in charToDate(x) : character string is not in a standard unambiguous format"

Here is a more detailed code from pipeline:

```
# Fixed month and day
date_month <- "2"
date_day <- "29"

# Loop by years
for(date_year in c("2020", "2021")) {

   s_date <- paste0(date_year, "-", date_month, "-", date_day)

   # BUG
   date_selected <- as.Date(s_date, origin = "1970-01-01")

}

```

How it's possible to process this bug without a broken pipeline. For example, by adding the next valid date "2021-03-01".

Thanks!