kamoonwalka
kamoonwalka

Reputation: 11

Redshift to R Shiny Connectivity

Are there any existing packages in R or somewhere else that can connect AWS Redshift clusters to R shiny apps? I'm trying to build up an interactive dashboard using Shiny and the data source is primarily Amazon Redshift or S3. Any workable alternatives or suggestions are welcomed too.

Upvotes: 1

Views: 1395

Answers (3)

Ritz735
Ritz735

Reputation: 135

I know this is an old post but wanted to mention RPostgres.

Unlike RPostgreSQL, RPostgres supports SSL and parameterization. Plus, you don't have to download an additional driver like RJDBC.

More on this here: https://auth0.com/blog/a-comprehensive-guide-for-connecting-with-r-to-redshift/

Upvotes: 1

MiloBellano
MiloBellano

Reputation: 396

I am using R Shiny with redshift with very nice results. First you have to install

library(RPostgreSQL)
library(shinydashboard) #just if you want to use nice dashboards

 drv <- dbDriver("PostgreSQL")
 conn <- dbConnect(drv, host="blabla.eu-west-1.redshift.amazonaws.com", 
 port="5439", dbname="xx,  user="aaaaa",  password="xxxxx")
 conn #run you connection
 test <-data.frame( dbGetQuery(conn, "select * from youtbalename"))

That is working for me.

Upvotes: 1

John Hearty
John Hearty

Reputation: 1

I've connected in the past using both RJDBC and RPostgreSQL - both work pretty well.

Bear in mind that both ODBC and JDBC Redshift drivers aren't supported on Shinyapps.io (because Shinyapps.io is built on Ubuntu) - RPostgreSQL may therefore be your best bet.

It's very easy to get a working connection in either RJDBC or RPostgreSQL.

Upvotes: 0

Related Questions