I haven't been able to figure out or find any resources for how to build a plot from a user selected column in a shiny formatted RMD. I do not want to have an embedded shiny app in the rmd unless that's the only option.
Normally, I would set an output object like DT::dataTableOutput("my_datatable")
Then take the selected column in this way input$my_datatable_columns_selected and use that to plot. However, this functionality doesn't seem to exist unless I embed a shiny app within rmd.
Is this possible?
Below is a mini rmd with a selectable table.
Thanks!
---
title: "Test"
output:
flexdashboard::flex_dashboard:
theme: bootstrap
orientation: rows
# params:
runtime: shiny
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(shiny)
library(flexdashboard)
#library(data.table)
library(DT)
library(highcharter)
library(crosstalk)
```
Info {.sidebar data-width=300}
-----------------------------------------------------------------------
Example here:
Row
-----------------------------------------------------------------------
### Plot
```{r, echo=FALSE}
print("PLOT OUTPUT from column selection")
```
Row
-----------------------------------------------------------------------
### mtcars
```{r, echo=FALSE}
DT::renderDataTable(mtcars,
selection = list(mode = "single", target = "column"),
options = list(scrollX = TRUE))
```
