'error: replacement has 0 rows, data has 1186

data <- read_csv(files, show_col_types = FALSE, skip=7)
   library(lubridate) 
  temp<- data.frame(data$Date)
ymd <- ymd(temp$Date) 
dmy <- dmy(temp$Date) 
ymd[is.na(ymd)] <- dmy[is.na(ymd)]
temp$Date <- ymd
data$Date<-temp

Im getting a runtime error:- Error in $<-.data.frame(*tmp*, "Date", value = numeric(0)) : replacement has 0 rows, data has 1186. Im trying to make a new temporary df to store dates in to parse it to a readable date format. Please help someone ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source