Hi Tammy, I think we need more information.
Are the names always four parts? Does the fix always involve moving two parts from the back to the front? For that matter, which of the two you gave is correct? Or does it matter what order the parts are in as long as it's consistent? Sorting them would be easiest, and would work regardless of number of parts and how they were entered. That could be done, for instance, with strsplit(), sort() and paste(). Sarah On Wednesday, September 26, 2012, Tammy Ma wrote: > > Dear R user: > > > I have got the following problem: > > I have imported two data sets into R: one set includes price information, > another one includes volume information. but I noticed the wrong data order > problem in the product name, > > for instance, > > in one data set, > > "GALAXY ACE S 5830" > > in another one, > > it is "S 5830 GALAXY ACE" > > both represent same product. how do i map two name into one in R? > > there are so many product name having this problem. i hope there is some > mechanism which can autimatically map those. thanks for your help.. > > > Kind regards, > Tammy > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org <javascript:;> 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. > -- Sarah Goslee http://www.stringpage.com http://www.sarahgoslee.com http://www.functionaldiversity.org [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org 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.