Skip to content
Prev 238910 / 398500 Next

Cbind query

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