How do I remove part of a string? For example in ATGAS_1121 I want to remove everything before _.
ATGAS_1121
_
Here's the strsplit solution if s is a vector:
strsplit
s
> s <- c("TGAS_1121", "MGAS_1432") > s1 <- sapply(strsplit(s, split='_', fixed=TRUE), function(x) (x[2])) > s1 [1] "1121" "1432"