'Rpivot Table not showing all rows of data

I am working with the Pivot table from rpivotTable package in RMarkdown with flex_dashboard. Below you can see code

---
title: "TEST"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
---

```{r setup, include=FALSE}
library(rpivotTable)
library(dplyr)
library(flexdashboard)
```


### Pivot table

```{r,eval=TRUE}

iris %>%
tbl_df %>%
rpivotTable(rows="Sepal.Width",rendererName="Table",aggregatorName = "Sum")


```

This code produce a Pivot table and everything is ok with the table. But the problem arises when I want to see all data in a table. Let's say that we want to see data for Sepal.Lenght and Sepal.Winth together. Below you can how is look like this example

enter image description here

With this selection, I can't see the bottom of the data because from the right side of RMarkdown html file there is no slider. So can anybody help me with how to solve this problem and to see all data ?



Solution 1:[1]

With vertical-layout set to fill, your sizing is heavily constrained. If you set this to scroll, you'll see much better results. If that doesn't get you where you need to be then read on.

This will be a very useful add-on but I'm pretty sure it's not going to help at all if you leave this set to fill. Add this chunk anywhere in your RMD file. This won't do anything if you try to run the chunk without knitting. It only does its thing with a knit.

When you move a column to a row, a row to a column, or resize your table in one of the many possible ways that it can be done, this script will move content around your table, so nothing overlaps and everything remains visible. It will not make your dashboard wider, though. So if your table exceeds any presets for the width of the dashboard, you have to rely on scrolling. (It will make your dashboard longer if it's necessary, though.)

```{r spicy,engine="js",include=FALSE,results="asis"}

scrp = ["https://cdnjs.cloudflare.com/ajax/libs/css-element-queries/1.2.3/ElementQueries.min.js",
        "https://cdnjs.cloudflare.com/ajax/libs/css-element-queries/1.2.3/ResizeSensor.js"];

setTimeout(function(){ // this function adds the URLs to the HTML <head>
  for(i=0; i < scrp.length; i++) {
    script = document.createElement('script');
    script.src = scrp[i];
    script.type = "text/javascript";
    document.head.appendChild(script);
  }
  ElementQueries.listen(); // just listen!!
}, 200); //wait a sec!
```

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1