[R] remove repeated string in list

Karim Mezhoud kmezhoud at gmail.com
Wed Mar 4 19:09:54 CET 2015


Dear All,
here an example
temp <- list(set1=c("a","b","d","x"), set2=c("b","c","q","m"),
set3=c("b","f","e","k","q","h"))

preserve only the first one string

>temp
set1 a b d x
set2 c q m
set3 f e k h

OR

remove repeated string

>temp
set1 a d x
set2 c m
set3 f e k h

Thanks

	[[alternative HTML version deleted]]



More information about the R-help mailing list