This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% !TeX document-id = {cf6594ac-97a2-46b5-af4f-f9d9c8aaa47d} | |
% !TeX TXS-program:compile = txs:///pdflatex/[--shell-escape] | |
\documentclass{article}% | |
\usepackage{filecontents}% | |
\begin{filecontents*}{tmp.tex}% | |
\input{tikz-board}% | |
\end{filecontents*} | |
%% | |
%% compile pdf | |
\immediate\write18{pdflatex tmp} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# server.R | |
library("shiny") | |
shinyServer( | |
function(session, input, output) { | |
observe({ | |
if (is.null(input$submit) || input$submit == 0){return()} | |
js_string <- 'alert("Do you want to submit now?");' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# server.R | |
library("shiny") | |
shinyServer( | |
function(input, output, session) { | |
# Reactive slider | |
v <- reactiveValues(min = -5, max = +5, status = 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# server.R | |
shinyServer(function(input, output, session) { | |
output$sliders <- renderUI({ | |
if (is.null(input$n) || is.na(input$n)) { | |
n <- 1 | |
} else { | |
n <- round(input$n,0) | |
} | |
lapply(1:n, function(i) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# server.R | |
library("shiny") | |
library("shinyAce") | |
shinyServer( | |
function(input, output) { | |
# A reactiveValues object holds the value of the counter | |
values <- reactiveValues(i = 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# server.R | |
shinyServer( | |
function(input, output, session){ | |
# This approach triggers a delay when the box is filled before the actionButton is actioned | |
# busyReactive <- reactive({ | |
# delay <- as.integer(input$delay) | |
# if(input$trigger > 0) {Sys.sleep(delay)} | |
# return(input$trigger) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# server.R | |
shinyServer( | |
function(input, output, session){ | |
# Part I: create an observer on the state of actionButton "calculate" | |
busy <- reactiveValues(state = 0) | |
observe({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# server.R | |
library("shiny") | |
shinyServer( | |
function(input, output, session) { | |
# Debug Area | |
output$Console <- renderUI({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# global.R | |
# customize display settings here | |
gTags <- function() { | |
tags$head( | |
tags$style( | |
type = 'text/css' | |
, "body {font-size: 80%; color: rgb(0,0,100);}" | |
, "#mainPanelId {min-width: 50%; max-width: 70%; float: right;}" | |
, "#sidebarPanelId {min-width: 10%; max-width: 20%; float: left;}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# server.R | |
library("shiny") | |
library("shinyIncubator") | |
shinyServer( | |
function(input, output) { | |
# table of outputs | |
output$table <- renderTable({ | |
res <- matrix(apply(input$data,1,prod)) |