Skip to content
Back to formatted view

Raw Message

Message-ID: <737ba45250b42aa1d804b75bd4871750@tin.it>
Date: 2005-04-04T14:32:36Z
From: Simone Gabbriellini
Subject: mysql retrive question

hello R-Users,
I have this simple but not for me question:

I do:

 > res<-dbSendQuery(con, "SELECT * FROM tabellaProva")
 > myDataFrame<-fetch(res)
 > myDataMatrix<-as.matrix(myDataFrame[,-1])
 > namerows(myDataMatrix)<-as.character(myDataFrame[,1])

and I have:

       io  tu
io  "0" "1"
tu  "1" "0"

my problem is that the content of the matrix is interpreted by R as 
strings, not as numbers.
Is there a way to convert those characters to numbers like

     io  tu
io  0 1
tu  1 0

thanx in advance,
simone