Row

Plot

Row

Table

---
title: "Population Pharmacokinetics Virtual Screen Results: Top 10 Objective Function Profiles"
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
    theme: lumen
    source_code: embed
---

```{r setup, include=FALSE}
library(flexdashboard)
library(crosstalk)
library(dplyr)
library(plotly)
library(DT)
library(ggplot2)

setwd("~/pmd/nldpTest")

results <- read.csv(file = 'vscreen3results1.csv')

my_colnames <- colnames(results)

maxpropspacesets <- read.csv(file = 'maxpropspacesets.csv')

sd <- SharedData$new(results)
```

Inputs {.sidebar}
-----------------------------------------------------------------------

```{r}

filter_checkbox("pid", "Prop Set", sd, ~PID, inline = FALSE)
```

Row {data-height=600}
-------------------------------------

### Plot

```{r}

fig <- plot_ly(sd, x = ~Time, y = ~Min, color = ~PID, type = 'scatter', mode = 'lines', name = ~PID, line=list(shape="spline"))
  fig <- fig %>% add_trace(y = ~Max, color = ~PID, type = 'scatter', mode = 'lines', name = ~PID, line=list(shape="spline"))
  fig <- fig %>% add_trace(y = ~Fit, color = ~PID, type = 'scatter', mode = 'lines', name = ~PID, line=list(shape="spline"))
  fig <- fig %>% layout(xaxis = list(title = paste(my_colnames[2])), yaxis = list(title = paste(my_colnames[6])))

fig
```

Row {data-height=400}
-------------------------------------

### Table

```{r}
library(DT)

datatable(maxpropspacesets, extensions="Scroller", style="bootstrap", class="compact",
          width="100%", rownames=NULL,
          options=list(
            deferRender=TRUE, scrollY=300, scroller=FALSE, paging=FALSE,
            columnDefs = list(list(className = 'dt-right', targets=c(0)))
          )
        )
```