I have a data frame that has 3 variables that I would like to split into 4 variables. The data frame looks like this:
Species_Name SIXTEENS_Title SIXTEENS_Sequence
Daphnia magna LC382445.1 Daphnia magna mitochondrial TTCGGAGAAAAGGGGTAC...
Daphnia magna KY694374.1 Daphnia magna mitochondrial TTCGGAGAAAAGGGGTAC...
From this data frame, under the SIXTEENS_Title
, I want to extract everything before Daphnia
(the alphanumerical LC382445.1, KY694374.1 ; but there are over 100 observations with different numbers).
I've tried using str_extract()
and str_detect()
but I can't seem to be able to do it. I want to use the accession numbers (LC382445.1)
to create another column in R.