Learn R Programming

redshift (version 0.5)

redshift.query: Executes a query

Description

Executes a query and returns the result set as a dataframe.

Usage

redshift.query(conn, ...)

Arguments

conn
The database connection
...
Strings representing the query. These will be concatenated together with paste to make it easier to write multi-line queries

Value

Data frame containing the results.

Examples

Run this code
require(redshift)
# conn <- redshift.connect("jdbc:postgresql://blah.blah.eu-west-1.redshift.amazonaws.com:5439/data", "username", "password")
results <- redshift.query(conn, "SELECT MAX(timestamp)",
                                "FROM weblog")

Run the code above in your browser using DataLab