This file contains 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 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 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
// This script just listens for "enter"s on the text input and simulates | |
// clicking the "send" button when that occurs. Totally optional. | |
jQuery(document).ready(function(){ | |
jQuery('#entry').keypress(function(evt){ | |
if (evt.keyCode == 13){ | |
// Enter, simulate clicking send | |
jQuery('#send').click(); | |
} | |
}); | |
}) |
This file contains 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 | |
# Static Non-Reactive Area | |
# Read Survey Questions & Suggested Answers | |
Q <- read.csv("survey.csv", 'header' = FALSE) | |
# column 1 : questions | |
# column 2+: several answers | |
# Store Survey Questions & User Answers in a dataframe |
This file contains 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
## create 'nice' annual breaks for use with ggplot | |
## because sometimes it's tedious to 'manually' set the minimum and maximum of the date range, | |
## when the data starts on odd years, like 1927, but you really want the labels to start at 1925 | |
## x denotes the date variable, e.g. x = df$date | |
## for m = 5, the breaks will be multiples of 5 years | |
## breaks below min and above max | |
## replace floor and ceiling with round, if desired | |
annual_breaks <- function(x, m = 5) { | |
require('scales') |
This file contains 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("ggplot2") # Grammar of Graphics for plots | |
library("VGAM") # Vector Generalized Linear and Additive Models | |
library("eeptools") # Convenience functions for education data | |
shinyServer( | |
function(input,output){ |
This file contains 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
# Script to demonstrate distributions | |
library(VGAM) | |
library(eeptools) | |
library(shiny) | |
library(ggplot2) | |
shinyServer(function(input,output){ |
This file contains 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("ggplot2") # Grammar of Graphics for plots | |
library("eeptools") # Convenience functions for education data | |
# static function | |
rnormcor <- function(x,rho) {rnorm(1,rho*x,sqrt(1-rho^2))} | |
shinyServer( |
This file contains 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("ggplot2") # Grammar of Graphics for plots | |
library("eeptools") # Convenience functions for education data | |
library("plyr") # Convenience functions to manipulate data | |
shinyServer( | |
function(input,output){ | |
OlderNewer