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
getPackage <- function(pkg){ | |
if(!require(pkg, character.only=TRUE)){ | |
install.packages(pkg, dependencies=TRUE) | |
library(pkg, character.only=TRUE) | |
} | |
return(TRUE) | |
} | |
getPackages <- function(pkgs){ | |
for (pkg in pkgs){ |
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
myfun <- function(x) deparse(substitute(x)) | |
# so myfun(myQOG) will give output "myQOG" |
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(data.table) | |
x <- data.table(A = c(3,2,1), B = 4:6) | |
y <- data.table(A = 1:4, C = 5:8) | |
z <- data.table(A = 2:3, D = 5:6) | |
tbls <- list(x, y, z) | |
lapply(tbls, function(i) setkey(i, A)) | |
merged <- Reduce(function(...) merge(..., all = T), tbls) |
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
library(shiny) | |
shinyServer(function(input, output, session) { | |
# Partial example | |
output$meh <- renderPrint({ | |
print("Meh --- ") | |
print(input$myTextInput ) | |
print(input$passInput ) | |
}) |
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
Benford's Law with Data Examples Shiny App | |
Base R code created by Jimmy Doi | |
Shiny app files created by Jimmy Doi | |
Cal Poly Statistics Dept Shiny Series | |
http://statistics.calpoly.edu/shiny |
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) | |
# Define server logic for random distribution application | |
shinyServer(function(input, output) { | |
# Reactive expression to generate the requested distribution. This is | |
# called whenever the inputs change. The renderers defined | |
# below then all use the value computed from this expression | |
data <- reactive({ | |
dist <- switch(input$dist, |
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
Type: Shiny | |
Title: conditionalPanel demo | |
License: MIT | |
Author: Winston Chang <winston@rstudio.com> | |
AuthorUrl: http://www.rstudio.com/ | |
Tags: conditionalpanel | |
DisplayMode: Showcase |
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(rmarkdown) | |
shinyServer(function(input, output) { | |
output$html = reactive({ | |
t <- tempfile() | |
cat(input$markdown, file = t) |
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
# load other helper files | |
# load textMiningTools function | |
source("textMiningTools.R", local=TRUE) | |
plotText <- function(fPath, | |
minWords, | |
scaleVec, | |
wordFreq, | |
plotType, | |
plotOptions, |
OlderNewer