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:
- Download and install MySQL Connector/ODBC for your operating system.
- Create a DSN in the ODBC Configuration Manager by selecting the correct driver for your platform.
- In R, execute install.packages("RODBC").
To use the RJDBC package, perform the following steps:
- Download and install MySQL Connector/J for your operating system.
- Install Java Runtime, and set the JAVA_HOME ...