Hi, There was a typo in my previous email. vec1<-"Iphone 4S 16 G" vec2<-"4S G 16 Iphone" vec3<-"16 G Iphone 4S" vec4<-"3S G 16 Iphone"
res11<- paste(sort(unlist(strsplit(vec1," "))),collapse="_") # I typed vec4 instead of vec1 res33<-paste(sort(unlist(strsplit(vec3," "))),collapse= "_") res44<-paste(sort(unlist(strsplit(vec4," "))),collapse= "_") res11 #[1] "16_4S_G_Iphone" identical(res11,res33) #[1] TRUE identical(res11,res44) #[1] FALSE I am not sure what the problem is. It works with this example. If you can provide some details, then it would be more helpful. A.K. ________________________________ From: Tammy Ma <[email protected]> To: [email protected]; "[email protected]" <[email protected]> Sent: Thursday, November 8, 2012 8:12 AM Subject: Re: [R] map two names into one Thanks. Yes. Your approach can identify: Glaxy ace S 5830 and S 5830 Glaxy ace But you can not identify using same program: Iphone 4S 16 G Iphone 4S 16G How should I solve both in same time. Kind regards, Tammy ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

