R/genus.R

Defines functions genus

Documented in genus

genus <- function(x) {
   
   # remove brackets and single quotes
   x <- gsub("\\[|\\]|'", "", x)
   x <- gsub("candidate |Candidatus ", "", x) ## remove Candidate species??? 
   y <- strsplit(x, "\\s+")
   sapply(y, '[', 1) 
}

Try the genomes package in your browser

Any scripts or data that you put into this service are public.

genomes documentation built on Nov. 8, 2020, 7:45 p.m.