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
shinyServer(function(input, output) { | |
output$obs <- renderUI({ | |
sliderInput("obs", "Number of observations:", | |
min = 10000, max = 90000, | |
value = 50000, step = 10000) | |
}) | |
output$distPlot <- renderPlot({ | |
if (!is.null(input$obs)) { | |
dist <- NULL | |
for (i in 1:input$obs) { |
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
"Year" "MeldingsNr" "HF0105" "HF0208" "HF0305" "HF0502" "HF0601" "HF0707" "HF0806" "HF1005" "HF1101" "HF1107" "HF1305" "HF1406" "HF1502" "HF1504" "HF1608" "HF1701" "HF1702" "HF1801" "HF1903" | |
"1" "2011" 100 58 NA NA NA 19 NA NA NA NA NA NA NA NA NA NA NA NA NA NA | |
"2" "2011" 200 48 NA NA NA 16 NA NA NA NA NA NA NA NA NA NA NA NA NA NA | |
"3" "2011" 250 2 NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA | |
"4" "2011" 400 3 NA NA NA 6 NA NA NA NA NA NA NA NA NA NA NA NA NA NA | |
"5" "2011" 401 2 NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA | |
"6" "2011" 602 1 NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA | |
"7" "2011" 700 137 NA NA NA 1 NA NA NA NA NA NA NA NA NA NA NA NA NA NA | |
"8" "2011" 750 2 NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA | |
"9" "2012" 100 178 NA 40 NA 637 303 NA 98 NA 135 22 NA 39 1 56 NA NA 34 19 |
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
shinyServer(function(input, output) { | |
output$hist1 <- renderPlot({ | |
n <- (input$obs) | |
dist <- NULL | |
for (i in 1:n) { | |
dist <- c(dist, rnorm(1)) | |
} | |
hist(dist,main = paste("hist1", n), breaks = 100) |
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
shinyServer(function(input, output) { | |
datasetInput <- reactive({ | |
switch(input$dataset, | |
"rock" = rock, | |
"pressure" = pressure, | |
"cars" = cars) | |
}) | |
output$caption <- renderText({ |
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
library(shiny) | |
library(datasets) | |
Logged = FALSE; | |
PASSWORD <- data.frame(Brukernavn = "withr", Passord = "25d55ad283aa400af464c76d713c07ad") | |
# Define server logic required to summarize and view the selected dataset | |
shinyServer(function(input, output) { | |
source("www/Login.R", local = TRUE) | |
observe({ | |
if (USER$Logged == TRUE) { |
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
shinyServer(function(input, output) { | |
observe({ | |
print(input$daterange) | |
}) | |
}) |
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
shinyUI(pageWithSidebar( | |
# Include css file; | |
tagList( | |
tags$head( | |
tags$title("Upload Data"), | |
tags$h1("Test") | |
) | |
), | |
# Control panel; |
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
#!/usr/bin/python | |
''' | |
A Simple mjpg stream http server for the Raspberry Pi Camera | |
inspired by https://gist.github.com/n3wtron/4624820 | |
''' | |
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer | |
import io | |
import time | |
import picamera |
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
(function(uustats){ | |
uustats.sdev = function(series) { | |
return Math.sqrt(uustats.variance(series)); | |
}; | |
uustats.variance = function(series) { | |
var t = 0, squares = 0, len = series.length; | |
for (var i=0; i<len; i++) { |
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
_.mixin({ | |
sum : function(data){ | |
return _.reduce(data, function(memo, num){ return memo + num; }, 0); | |
}, | |
mean : function(data){ | |
return this.sum(data)/data.length | |
}, | |
median : function(data){ | |
return this.percentile(data,50); | |
}, |
OlderNewer