I'm trying to remove the text " 12:00:00 AM" from the string e.g: "4/12/2016 12:00:00 AM" from the column "ActivityDate"
I'm using this pipe:
Sleep <- sleepDay_merged %>%
rename('ActivityDate' = 'SleepDay') %>%
gsub("12:00:00 AM","",'ActivityDate')
And I get this error:
In addition:
Warning message:
In sub(., "12:00:00 AM", "", "ActivityDate") :
argument 'pattern' has length > 1 and only the first element will be used
Could please help me?
Cheers