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
/******************************************************************** | |
* | |
* Script to insert random Youtube embed into index.html | |
* | |
*******************************************************************/ | |
// The array of objects, one object for each artist. | |
const artists = [ | |
{ |
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
library(tidyverse) | |
xVals <- function(n, center, width) { | |
seq(from = center - width, to = center + width, length.out = n) | |
} | |
width <- 0.3 | |
survey <- tigerstats::m111survey | |
gms <- | |
survey %>% | |
group_by(seat) %>% |
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
## Experiment with the constants below (e.g., the 5, 25, 8, etc.) so see if you can get the effect you want. | |
## Note that wrapping the loop in turtle_do makes it run a good bit faster | |
## Also think about what you can do to keep the turtle tracing over itself when it repeats 50 drips | |
library(TurtleGraphics) | |
turtle_drip_pollack<-function(n=50){ | |
turtle_init(75,75, mode = "clip") | |
repeat { | |
for( i in 1:n){ | |
turtle_do({ |
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
license: MIT | |
height: 1000 |
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
initz <- c(5,10,0,10) | |
mySystem <- list( | |
dz1 = function(t,zs) zs[2], | |
dz2 = function(t,zs) zs[1]^2+zs[3]+2*zs[4]+2*t, | |
dz3 = function(t,zs) zs[4], | |
dz4 = function(t,zs) zs[1]+zs[2]+3*zs[3]^2+5*t | |
) | |
rungeKutta <- function(t0,z0,t1,steps,fns) { | |
h <- (t1-t0)/steps |
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
license: MIT | |
height: 1000 | |
border: no |
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
# x is xo, y is y0, x1 is x-value for which you want y, n is number of steps, | |
# f is the function f in the DE dy/dx = f(f,) | |
rungeKutta <- function(x, y, x1, n, f) { | |
h <- (x1 - x) / n | |
X <- numeric(n + 1) | |
Y <- numeric(n + 1) | |
X[1] <- x | |
Y[1] <- y | |
for ( i in 1:n ) { | |
xhalf <- x + 0.5 * h |
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
library(shiny) | |
library(shinydashboard) | |
ui <- dashboardPage( | |
dashboardHeader(), | |
dashboardSidebar(), | |
dashboardBody(), | |
tags$head(tags$style(HTML(" | |
.skin-blue .main-sidebar { | |
background-color: yellow; |
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
function(input,output) { | |
output$sliderout <- renderText({ | |
if (exists_as_numeric(input$numinput)) { | |
isolate(input$sliderinput) | |
} | |
}) | |
output$numout <- renderText({ | |
input$numinput | |
}) | |
} |