Hi all!

I do hope question from newcomers are wellcome here! Thanks in advance.

Trying to catch up and to acquired the needed background to easily  
read R documents it is being a bit hard to me to get into the  
required concepts to deal with data.

I am trying to get data from a MySQL database and plotting it with  
barplot. Here the code...

library(RMySQL)
con <- dbConnect(dbDriver 
("MySQL"),host='localhost',username='root',dbname='ibdona')
rs <- dbGetQuery (con,"select n,year from ibdona.library_location")
dbDisconnect(con)
Graph <- barplot(rs)

And here the error I get...

Error in barplot.default(rs) : 'height' must be a vector or a matrix

paste(rs) gives me...

[1] "c(307, 65, 2, 28, 3, 229, 81, 5, 7, 558, 134, 53, 9)"
[2] "c(2002, 2002, 2002, 2002, 2002, 2003, 2003, 2003, 2003, 2004,  
2004, 2004, 2004)"

So, I am guessing I've gotten the data but there is at least an step  
lacking to be able to use it as the entry matrix required by barplot.

Please, could you help me with this issue? What is the step/steps  
lacking in my quite short code? Thanks!!!

Best,


--
Ricardo Rodríguez
Your EPEC ICT Team




	[[alternative HTML version deleted]]

