570 search results for "sql"

MySQL and R

August 15, 2011
By

Using MySQL with R is pretty easy, with RMySQL. Here are a few notes to keep me straight on a few things I always get snagged on. Typically, most folks are going to want to analyze data that's already in a MySQL database. Being a little bass-ackwards, I often want to go the other way. One reason to do...

Read more »

Dump MySQL to CSV using R

August 10, 2011
By

Based on a related post on one of my favorite python-lists I remembered, that I wrote a similar snipplet some time ago. So if you want to dump your whole MySQL database to csv-files you can recycle the following code: ?Download mysql2cvs.R1 2 3 4 5 6 7 8 9 require(RMySQL) m<-MySQL() summary(m) con<-dbConnect(m, dbname

Read more »

Accessing MySQL through R

May 5, 2011
By

Connecting to MySQL is made very easy with the RMySQL package. To connect to a MySQL database simply install the package and load the library.install.packages("RMySQL")library(RMySQL)Connecting to MySQL:Once the RMySQL library is installed create a dat...

Read more »

Data Aggregation in R: plyr, sqldf and data.table

April 28, 2011
By
Data Aggregation in R: plyr, sqldf and data.table

I’ve also previously put up a couple of posts about aggregating data in R. In this post, I’m going to be trying some other alternative methods for aggregating the dataset. Before I begin, I’d like to thank Matthew Dowle for highlighting these to me. It’s a bit daunting at first, deciding which method of aggregating data is

Read more »

Applying functions on groups: sqldf, plyr, doBy, aggregate or data.table ?

March 17, 2011
By
Applying functions on groups: sqldf, plyr, doBy, aggregate or data.table ?

Which one of the sqldf, plyr, doBy and aggregate functions/packages would be faster for applying functions on groups of rows? I was wondering about this earlier in this post.  It seems sqldf would be the fastest according to a post in manipulatr m...

Read more »

Applying functions on groups: sqldf, plyr, doBy, aggregate or data.table ?

March 17, 2011
By
Applying functions on groups: sqldf, plyr, doBy, aggregate or data.table ?

Which one of the sqldf, plyr, doBy and aggregate functions/packages would be faster for applying functions on groups of rows? I was wondering about this earlier in this post.  It seems sqldf would be the fastest according to a post in manipulatr m...

Read more »

Extracting all Crime Data for England and Wales using R and MYSQL

February 14, 2011
By
Extracting all Crime Data for England and Wales using R and MYSQL

Last week I started creating some data extraction code for the new England and Wales crime maps website using the R software / language. Although there is an API, a more efficient way of accessing all of the data (and without causing stress to their API server) is to download the CSV files located here

Read more »

Extracting all Crime Data for England and Wales using R and MYSQL

February 14, 2011
By
Extracting all Crime Data for England and Wales using R and MYSQL

Last week I started creating some data extraction code for the new England and Wales crime maps website using the R software / language. Although there is an API, a more efficient way of accessing all of the data (and without causing stress to their AP...

Read more »

sqldf and grouping rows in R

February 8, 2011
By

In R, you can treat tables (or data.frames as they are called in R) as SQL tables. That means you can query them as you would query a database with SQL commands. This is particularly useful 1) if you know SQL, hahah:)  2) if you have large tabl...

Read more »

sqldf and grouping rows in R

February 8, 2011
By

In R, you can treat tables (or data.frames as they are called in R) as SQL tables. That means you can query them as you would query a database with SQL commands. This is particularly useful 1) if you know SQL, hahah:)  2) if you have large tabl...

Read more »