I am doing some processing and this is my code
wrongDateValues <- function(date){
    wrongIndexes <- c()
    wrongValues <- c()
    for(value in date){
      formattedDate <- strptime(value, "%Y%m%d")
      if(is.na(formattedDate)){
        wrongValues <- c(wrongValues, value)
        wrongIndexes <- c(wrongIndexes, value)
      }
    }
    wrongResults <- matrix(c(wrongValues, wrongIndexes), byrow = FALSE, ncol = 2)
    colnames(wrongResults) <- c("WrongValues", "WrongIndexes")
    return (wrongResults)
}
as you see, now in the wrongIndexes i am saving the values, because ** i don't know how to save the index**
could you help?
 
    