There are a lot of ways to do this but here is one. If the data has a dash change to NA:
Data[grepl("-", Data)]<-NA
Domanda
I have one variable in a data frame that lists different times, but there are some values that are actually dates. It would look something like:
Data<-c("0:03","1:15","20:37","27-Jun-12","3:55","5-May-13")
I would like to change those date values into missing values without touching any of the times. Any help is appreciated.
Soluzione
There are a lot of ways to do this but here is one. If the data has a dash change to NA:
Data[grepl("-", Data)]<-NA