I have a matrix like this (each row is a row):
m <- matrix(c("Agarista revoluta (Spreng.) Hook. f. ex Nied.",
"Amaioua intermedia Mart.",
"Baccharis reticularia DC."),, 1)
I would like to remove the text after the second space and return:
Agarista revoluta
Amaioua intermedia
Baccharis reticularia
I tried several combinations with gsub, but I failed.
Can anyone help me with this?
source
share