Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(stringr)
- library(twitteR)
- library(plyr)
- library(ROAuth)
- library(base64enc)
- library(shiny)
- require(RJSONIO)
- library(RMySQL) # will load DBI as well
- options(shiny.sanitize.errors = FALSE)
- lapply( dbListConnections( dbDriver( drv = "MySQL")), dbDisconnect)
- con <- dbConnect(dbDriver("MySQL"), user = "user_name", password = "passowrd", dbname = "db_name", host="remotehost.org")
- on.exit(dbDisconnect(con))
- test <- dbGetQuery(con, paste("SELECT * FROM tablename WHERE columnname = '","'"))
- ui <- fluidPage(textOutput(outputId="jsonoutput"))
- server <- function(input, output) {
- output$jsonoutput <- renderText({
- toJSON(list(NLP = test))
- })
- }
- dbDisconnect(con)
- shinyApp(ui = ui, server = server)
Add Comment
Please, Sign In to add comment