Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Until now, you’ve been using R statements to manipulate data. But many data analysts come to R well versed in Structured Query Language (SQL). It would be a shame to lose all that accumulated knowledge. Therefore, before we end, let me briefly mention the existence of the sqldf package. (If you’re unfamiliar with SQL, please feel free to skip this section.)
After downloading and installing the package (install.packages("sqldf")), you can use the sqldf() function to apply SQL SELECT statements to data frames. Two examples are given in the following listing.