I'm having difficulties with the placement of plots and tables within flexdashboard
. Here's a reprex:
---
title: "FlexDashboard"
output:
flexdashboard::flex_dashboard:
orientation: column
---
```{r setup, include=FALSE}
library("flexdashboard")
library("dplyr")
library("ggplot2")
library("plotly")
library("DT")
```
```{r}
library(datasets)
data(iris)
iris <- iris
```
Column {data-width=500}
-----------------------------------------------------------------------
### **Chart**
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labor et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
```{r, fig.height=3, fig.width=8}
ggplotly(ggplot(data = iris, aes(x = Sepal.Length, y = Petal.Width)) + geom_point())
```
### Chart B
```{r}
```
Column {data-width=500}
-----------------------------------------------------------------------
### Chart B
```{r}
iris %>%
datatable(
rownames = FALSE,
class = 'cell-border stripe',
extensions = c('Buttons', 'KeyTable'),
options = list(dom = 't',
autoWidth = TRUE,
buttons = c('copy', 'excel', 'print'),
keys = TRUE)
)
```
There are two problems:
- The plotly graph is cut off. I tried to play with
fig.width
andfig.height
to no avail. - The DT table does not display the buttons and the header row is not aligned