R/strip.spec.R

strip.spec <- function(x){
  if ( is.factor(x) ) x <- levels(x)[x]
  sepchar <- ifelse(length(grep("_", x)) != 0, "_", " ")
  x <- strsplit(x, sepchar)
  sapply(x, function(x) x[1])
}

Try the megaptera package in your browser

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

megaptera documentation built on Jan. 15, 2017, 11:19 p.m.