I have a data frame done this way:
a b c -------------------------------- 1 2011 mal ID9 2 2012 yesterday ID10 3
This should work
z$c=gsub(" ID.*","",z$c)