un2(vec4))
#[1] FALSE
vec5
#[1] "Iphone 4S 16G"
identical(fun2(vec6),fun2(vec7))
#[1] TRUE
A.K.
From: Tammy Ma
To: smartpink...@yahoo.com; "r-help@r-project.org"
Sent: Thursday, November 8, 2012 8:12 AM
Subject: Re: [R] map two name
t;
fun1(vec6)
#[1] "5830aceGlaxyS"
identical(fun1(vec6),fun1(vec7))
#[1] TRUE
identical(fun1(vec5),fun1(vec1))
#[1] TRUE
identical(fun1(vec1),fun1(vec4))
#[1] FALSE
A.K.
From: Tammy Ma
To: smartpink...@yahoo.com; "r-help@r-project.org"
Sent:
ec4)
#[1] "16_3S_G_Iphone"
fun1(vec5)
#[1] "16_4S_G_Iphone"
identical(fun1(vec1),fun1(vec5))
#[1] TRUE
identical(fun1(vec1),fun1(vec4))
#[1] FALSE
A.K.
____
From: Tammy Ma
To: smartpink...@yahoo.com; "r-help@r-project.org"
Sent: Thursday, November 8, 2012 8:12 AM
S
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
To: smartpink...@yahoo.com; "r-help@r-project.org"
Sent: Thursday, November 8, 2012 8:12 AM
Subject: Re: [
;-paste(sort(unlist(strsplit(vec4," "))),collapse= "_")
res11<-paste(sort(unlist(strsplit(vec4," "))),collapse= "_")
identical(res11,res33)
#[1] FALSE
identical(res11,res44)
#[1] TRUE
A.K.
From: Tammy Ma
To: smartp
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
[[alternative
t;)
vec11
#[1] "5830_ACE_GALAXY_S"
vec22
#[1] "5830_ACE_GALAXY_S"
identical(vec11,vec22)
#[1] TRUE
vec33<-paste(sort(unlist(strsplit(vec3," "))),collapse="_")
identical(vec11,vec33)
#[1] FALSE
A.K.
- Original Message -----
From: Tammy Ma
To:
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
It may be easy or difficult depending on what your data are like.
"GALAXY ACE S 5830" vs "S 5830 GALAXY ACE"
One easy and reasonably general way would be to divide each such bit
into 4 "words" and then compare if set 2 contains exactly all words in
set 1 but possibly in different order.
x1 <- "G
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 o
10 matches
Mail list logo