I have a set of data like so
GSM482075 GSM482076 GSM482077 GSM482078 GSM482079 GSM482080 GSM482081 GSM482082
1 8.79703 8.04291 7.53674 9.94527 8.38775 8.02375 11.1607 10.5481
2 5.66556 6.42794 6.62527 6.19131 5.34138 5.69543 5.9252 5.55675
I want to transpose and turn the columns into rows and rows into columns but when I use t() it converts the numeric values into strings.
1 2
GSM482075 "8.79703" "5.66556"
GSM482076 "8.04291" "6.42794"
GSM482077 "7.53674" "6.62527"
GSM482078 "9.94527" "6.19131"
GSM482079 "8.38775" "5.34138"
GSM482080 "8.02375" "5.69543"
GSM482081 "11.1607" "5.9252"
GSM482082 "10.5481" "5.55675"
I've looked around but I haven't found a straightforward way to keep the numbers numeric. I was thinking about stripping out the labels but I haven't seen any answers on how to do that except people telling others not to. Any suggestions? thanks
EDIT: Results of str(geomatrixsub) 1st object shown
'data.frame': 2 obs. of 8 variables:
$ GSM482075: chr "8.79703" "5.66556"
$ GSM482076: chr "8.04291" "6.42794"
$ GSM482077: chr "7.53674" "6.62527"
$ GSM482078: chr "9.94527" "6.19131"
$ GSM482079: chr "8.38775" "5.34138"
$ GSM482080: chr "8.02375" "5.69543"
$ GSM482081: chr "11.1607" "5.9252"
$ GSM482082: chr "10.5481" "5.55675"
using t(geomatrixsub[1:2,] )
1 2
GSM482075 "8.79703" "5.66556"
GSM482076 "8.04291" "6.42794"
GSM482077 "7.53674" "6.62527"
GSM482078 "9.94527" "6.19131"
GSM482079 "8.38775" "5.34138"
GSM482080 "8.02375" "5.69543"
GSM482081 "11.1607" "5.9252"
GSM482082 "10.5481" "5.55675"