In the previous recipe, we showed that R connects very well with relational and SQL databases. However, recently, a new range of NoSQL databases have emerged rapidly in response to the growing ecosystem of applications that collect and process different types of data, with schema-less designs having more flexibility. We will illustrate this with MongoDB using the rmongodb and mongolite packages.
Reading data from NoSQL databases - MongoDB
Getting ready
Prepare the environment by following these steps:
- Download and install MongoDB.
- Start mongod as a background process.
- Make sure the Chicago_Crimes_2012_to_2017.csv file is in the working directory of R.
- Install the rmongodb, mongolite, ggplot2, ggmap, data.table, dplyr packages...