[R] Omitting repeated occurrence in a string

Christofer Bogaso bogaso.christofer at gmail.com
Wed Feb 6 17:46:56 CET 2013


Hello again,

I was looking for some way on How to delete repeated appearance in a
String. Let say I have following string:

Text <- "ahsgdvasgAbcabcsdahj"

Here you see "Abc" appears twice. But I want to keep only 1
occurrence. Therefore I need that:

Text_result <- "ahsgdvasgAbcsdahj" (i.e. the first one).

Can somebody help me if it is possible using some R function?

Thanks and regards,



More information about the R-help mailing list