Johnny J
Johnny J

Reputation: 11

What function to use to view database tables in R browser?

server<-function(input,output,session) {
observeEvent(input$do, {
con <- dbConnect(odbc::odbc(), "$$$$", uid = "$$$$", pwd = "$$$$")
result<-dbSendQuery(con,"select * from table_name")
data.frame<-dbFetch(result)
View(data.frame)

I have want the view the table in the R browser (not the console), so what function exactly need to use?

Upvotes: 1

Views: 511

Answers (1)

LyzandeR
LyzandeR

Reputation: 37879

One way would be to use tableHTML which would convert your data.frame into an HTML table to make it possible to view on RStudio's browser (or your browser):

As an example:

library(tableHTML)
tableHTML(mtcars)

Upvotes: 1

Related Questions