Reading data from databases
As R reads data into memory, it is perfect for processing and analyzing small datasets. However, as an enterprise accumulates much more data than individuals in their daily lives, database documents are becoming more common for the purpose of storing and analyzing bigger data. To access databases with R, one can use RJDBC
, RODBC
, or RMySQL
as the communications bridge. In this section, we will demonstrate how to use RJDBC
to connect data stored in the database.
Getting ready
In this section, we need to prepare a MySQL environment first. If you have a MySQL environment installed on your machine (Windows), you can inspect server status from MySQL Notifier. If the local server is running, the server status should prompt localhost (Online), as shown in the following screenshot:
Once we have our database server online, we need to validate whether we are authorized to access the database with a given username and password by using any database...