[R] have I an actual matrix?

Ricardo Rodríguez - Your EPEC ICT Team webmaster at environmentalchange.net
Wed Nov 8 21:18:32 CET 2006


On Nov 8, 2006, at 11:41 AM, Michael Kubovy wrote:

> On Nov 8, 2006, at 4:44 AM, Ricardo Rodríguez wrote:
>
> Hi Ricardo,
>
> You probably have two columns in 'rs'. You need to do the barplot  
> on one of them and use the other as the vector of labels. Assuming  
> that the first column is n and the second is years:
> barplot(n, names.arg = years, xlab = 'years', ylab = 'number of  
> events')
>
> if the columns are not labelled:
> barplot(rs[, 1], names.arg = rs[, 2], xlab = 'years', ylab =  
> 'number of events')
>
> For more details,
> ?barplot
> or
> ?barplot2
> Also try RSiteSearch('barplot')
> See also http://wiki.r-project.org/rwiki/doku.php? 
> id=graph_gallery:graph54

Thank you so much for the detailed answer, Michael.

Once I've understood that I've been trying to plot a data frame  
without specifying the columns I wanted to use thing are going  
smoother over here! Your answer has directed me to the RGraphGallery.  
What a repository of great ideas! I do hope I can contribute in the  
near future.

Just two tips: I don't know why, I am not able to use the link you  
have posted to reach graph 54. This one works for me...

http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=54

As for my error trying to plot a data frame, ?dbGetQuery clearly  
states that the function returns a data.frame with the results of the  
query. 4.3.1 Packages DBI and RMySQL clearly reads the same thing,  
dbGetquery sends the query and retrieves the results as a data frame.  
So, I must apology. Only my lack of skills and a non attentive  
reading of the manuals have caused this doubt. Thanks for your help.

With my best regards,

Ricardo



More information about the R-help mailing list