sqldf brokers your dataframe from R into a SQLite database, executes your SQL query, and brokers the data back as a new dataframe. Very nice. The documentation and literature reveals that it works with H2, MySQL, and PostgreSQL, and additionally does a whole lot more than the one-liner claims!