Skip to content

Instantly share code, notes, and snippets.

View rfaelens's full-sized avatar

rfaelens

  • Leuven, Belgium
View GitHub Profile
## Author: Ruben Faelens, 2021
## Goal: demo for RxODE use
## See https://nlmixrdevelopment.github.io/RxODE/articles/RxODE-sim-var.html for more examples
library(tidyverse)
library(RxODE)
modelCode <- "
KA = THETA1;
V = THETA2 * exp(ETA1) * (BW/70);
library(shiny)
library(shinyjs) #to easily run javascript
library(shinyBS) #shiny bootstrap; show error dialogs
### Set up a LinkedIn application first
### To do this, go to https://linkedin.com/developers
### Create an application, and set up the redirect URL to your Shiny application
### Go to products and activate Sign in with LinkedIn
ClientID <- "XXXXXXXXXXX" # see the Auth page for your app at https://linkedin.com/developers
ClientSecret <- "XXXXXXXXXX"
library(plotly)
library(ggplot2)
ui <- fluidPage(
column(6,
checkboxInput("go_table", label="Render table", value=TRUE),
tableOutput("table")
),
column(6,
checkboxInput("go_plot", label="Render plot", value=TRUE),
## Investigation for https://github.com/handsontable/handsontable/issues/2002
## and https://github.com/jrowen/rhandsontable/issues/159
##
ui <- fluidPage(
shinyjs::useShinyjs(),
rhandsontable::rHandsontableOutput("table"),
actionButton("swap", label="Swap borders!"),
actionButton("randomTop", label="Randomize top color"),
actionButton("randomBottom", label="Randomize bottom color")
library(shinytest)
library(magrittr)
app <- ShinyDriver$new("..", loadTimeout = 30000, seed=1234)
app$snapshotInit("test")
# Test modifying cells in rapid succession --------------------------------
## - Without any binding on the server side, this works perfectly
## - If we do not propagate the change from input$table -a-> state$df -b-> output$table, it works fine too
## - However, if we propagate the change input$table -a-> state$df -b-> output$table, it creates a race
library(shinytdmore)
library(shiny)
library(tibble)
library(rhandsontable)
Nstart <- 20
PlotSleep <- 2
ui <- fluidPage(
actionButton("add", label="Add row", icon=shiny::icon("add")),
# Author: Ruben Faelens, Copyright: 2020
# Licensed under MIT license
install_chromedriver <- function(version, baseURL="https://chromedriver.storage.googleapis.com") {
if (!grepl("/$", baseURL))
baseURL <- paste0(baseURL, "/")
if(missing(version)) {
tmp <- tempfile()
utils::download.file(paste0(baseURL, "LATEST_RELEASE"), tmp)
version <- readLines(tmp, warn=FALSE)
unlink(tmp)
library(timevis)
z <- timevis()
file1 <- tempfile(fileext=".html")
htmlwidgets::saveWidget(z, file1, selfcontained=TRUE)
rstudioapi::viewer(url=file1)
file2 <- tempfile(fileext=".html")
htmlwidgets::saveWidget(z, file2, selfcontained=FALSE)
rstudioapi::viewer(url=file2)