Displaying 1 result from an estimated 1 matches for "improvecat1".
Did you mean:
improvecat
2011 Jun 30
1
Match strings across two differently sized dataframes and copy corresponding row to dataframe
...maller dataframe with the codes, mydata is the
larger dataframe to which I would like to copy it.
commvec=charmatch(comments$ImproveOne, mydata$Improve) # this is the
match between the strings one way
datavec=charmatch(mydata$Improve, comments$ImproveOne) # this is the
match the other way
mydata$ImproveCat1=NA # produce a variable to hold the copied codes
mydata$ImproveCat1[datavec[!is.na(datavec)]]=
comments$ImproveCat[commvec[!is.na(commvec)]] # for all the non
missing row numbers identified in the larger dataframe-
# copy the corresponding code from the smaller dataframe (which lives
in comments$I...