O'Reilly logo

R Data Analysis Cookbook - Second Edition by Kuntal Ganguly

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Getting ready

First create a data frame to work with as follows:

> customer <- c("John", "Peter", "Jane") 
> orddt <- as.Date(c('2014-10-1','2014-1-2','2014-7-6')) 
> ordamt <- c(280, 100.50, 40.25) 
> order <- data.frame(customer,orddt,ordamt) 

Then install the MySQL server, and create in it a database called Customer.

To use the RODBC package, perform the following steps:

  1. Download and install MySQL Connector/ODBC for your operating system.
  2. Create a DSN in the ODBC Configuration Manager by selecting the correct driver for your platform.
  3. In R, execute install.packages("RODBC").

To use the RJDBC package, perform the following steps:

  1. Download and install MySQL Connector/J for your operating system.
  2. Install Java Runtime, and set the JAVA_HOME ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required