read

Installation:

> install.packages("RMySQL", dependencies = TRUE)
> library(RMySQL)

Simple usage:

> con <- dbConnect(MySQL(), user="msandbox", password="msandbox", dbname="sakila", host="127.0.0.1", port=5527)
> dbGetQuery(con, "select * from sakila.sales_by_store")
store manager total_sales
1 Woodridge,Australia Jon Stephens 33726.77
2 Lethbridge,Canada Mike Hillyer 33679.79
> sales_by_film_category <- dbReadTable(con, "sales_by_film_category")
> qplot(category, total_sales, data=sales_by_film_category, geom="bar", fill=category)</p>

</code>

Blog Logo

Fernando Ipar


Published

Image

Fernando Ipar

"Tell my wife I love her very much, she knows"

Back to Overview