I have a data like this :
and I want to delete the column which contain "rico" and also delete all next columns. I am looking to get this :

This is what i did but it doesnt work :
mydata = data.frame(
X1 = c("john", "max", "jay", "douglas"),
X2 = c("alexia", "miguel", "vince", "gary"),
X3 = c("peter", "rico", "joe", "jenny"),
X4 = c("marc", "kelly", "max", "jones")
)
mydata[,grepl("rico", names(mydata))]
Some help would be appreciated
