[R] Cbind query

karthicklakshman karthick.lakshman at gmail.com
Fri Oct 22 13:06:17 CEST 2010


I am new to R and request your kind help.

I have a table like the one below, 
   one         two
1  apple      fruit
2  ball         game
3  chair       wood
4  wood       plain
5  fruit        banana
6  cloth       silk

Note: duplicate entries are there

the task is to create relations to each each row entries, like "apple ->
fruit" . when I tried to combine column1 with column 2 (one, two), using
"cbind" the string is changed to numerical value...something like this
        [,1] [,2]
   [1,]   10   53
   [2,]   25  562
   [3,]   25  462
   [4,]   25 1045
   [5,]   25  488
   [6,]   26 1062
   [7,]   27  951
   [8,]   27  144
   [9,]   27  676
  [10,]   27  486

Please suggest me how to get the string names back like the first table in
the out put, using cbind.

Thanks in advance
regards
kaarz

-- 
View this message in context: http://r.789695.n4.nabble.com/Cbind-query-tp3006988p3006988.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list