문제

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.

도움이 되었습니까?

해결책

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top