search for: 11gagggtgtgggh

Displaying 1 result from an estimated 1 matches for "11gagggtgtgggh".

2010 Jul 16
2
Deleting a variable number of characters from a string
...to delete a variable number of characters from the string. The string itself contains the number of characters to be deleted. The number of characters to be deleted is proceeded by either a "+" or a "-". A toy example: Suppose I have x<-c("A-1CB-2GHX", "*+11gAgggTgtgggH") > x [1] "A-1CB-2GHX" "*+11gAgggTgtgggH" What I need as output is "ABX" "*H" I know I can use gsub to remove the control character and the number portion with gsub("(\\-|\\+)([0-9]+)", replacement="", x) However, I can...