1
$\begingroup$

I work in a stress testing team. my boss has asked me to generate an interactive report every day using different tables in a Sybase database. I know the table structure and sql queries, but can't get my head around implementing in Rstudio using shiny or markdown.

Please advise. thanks,

$\endgroup$

1 Answer 1

1
$\begingroup$

Here is a good overview of recommended ways:

http://r4ds.had.co.nz/r-markdown-formats.html#r-markdown-formats

I suggest using the package flexdashboard (heading "Dashboards"). Interactivity can be provided by htmlwidgets you can find an overview here:

http://www.htmlwidgets.org/

As an example, install:

install.packages('flexdashboards') # the dashboard
install.packages('plotly') # for interactive graphs
install.packages('DT') # for interactive tables
install.packages('tidyverse') # for data transformation etc

now create a dashboard as explained on

https://rmarkdown.rstudio.com/flexdashboard/

and fill it with your graph or tables. Here I use the starwars dataset provided in the package dplyr

---
title: "Single Column (Fill)"
output: 
  flexdashboard::flex_dashboard:
    vertical_layout: fill
---

### Chart 1

```{r}
library(tidyverse)
library(DT)
datatable(starwars %>% select(-films, -vehicles, -starships))
```

### Chart 2

```{r}
g <- starwars %>% 
  ggplot(aes(height, mass, color = gender)) +
  geom_point() +
  ggtitle("Mass vs. Height by gender")

library(plotly)
ggplotly(g)
```

output will be a html(interactive) file with table and graph:

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.