Database using Dplyr, DBI, and POOL

In this section, we will learn to use the dplyr package to access data from database sources. We will also see how to hook up to an external database using the DBI package. The Pool package is also an important topic to manage connections and prevent leaks to manage performance.

  • dplyr: A popular data-manipulation package for internal and external databases. It internally works as SQL. It provides a variety of functions for data manipulation:
    • filter()
    • select()
    • arrange()
    • rename()
    • distinct()
    • mutate()
    • transmute()
    • summarise()
    • sample_n()
    • sample_frac()

Let's see an example using some of these functions with the iris dataset:

library(dplyr) 
iris %>% filter(Sepal.Length>4 &Sepal.Length<5) 

In the preceding ...

Get Web Application Development with R Using Shiny - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.