Dear all, Does any one know how to remove part of the string? For example, "LTA4H||Leukotriene A4 hydrolase" is a gene name plus gene description. I hope to remove "||Leukotriene A4 hydrolase". What would be the R code to do that using gsub()? Many thanks! Bill
how to remove part of the string
5 messages · Bill Hyman, Rui Barradas, Martin Schilling +1 more
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120606/35f8e2f1/attachment.pl>
Hello, Try txt <- "LTA4H||Leukotriene A4 hydrolase" pattern <- "\\|\\|.*$" gsub(pattern, "", txt) Hope this helps, Rui Barradas Em 06-06-2012 21:45, Bill Hyman escreveu:
Dear all, Does any one know how to remove part of the string? For example, "LTA4H||Leukotriene A4 hydrolase" is a gene name plus gene description. I hope to remove "||Leukotriene A4 hydrolase". What would be the R code to do that using gsub()? Many thanks! Bill
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120606/a032cf0e/attachment.pl>
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120606/07a121c1/attachment.pl>