Displaying 1 result from an estimated 1 matches for "improveone".
Did you mean:
improvemnt
2011 Jun 30
1
Match strings across two differently sized dataframes and copy corresponding row to dataframe
...tring in the smaller dataframe, and then use that row number to copy
across the code for the string into the larger dataframe. Here's my
idea so far:
# comments is the smaller 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[...