Download and install:
- R
- RStudio
Download the dummy csv file from this gist ( https://gist.github.com/psychemedia/9690079 )
In RStudio run:
install.packages("shiny")
i | |
me | |
my | |
myself | |
we | |
our | |
ours | |
ourselves | |
you | |
your |
library(plyr) | |
library(ggplot2) | |
# Simulate data | |
numSubs = 40 | |
x = runif(numSubs, 0, 30) | |
x = c(x, x + abs(rnorm(numSubs, 2))) | |
y = 2 + x - 0.02*x^2 + rnorm(2*numSubs, 0, 1) |
#List of most used R packages that we wish to install. | |
libraries = c('cacheSweave', 'Deducer', 'devtools', 'doBy', 'foreign', 'gdata', | |
'ggplot2', 'Hmisc', 'JGR', 'lubridate', 'maps', 'mapdata', 'mapproj', | |
'maptools', 'proto', 'psych', 'R2wd', 'RCurl', 'reshape', | |
'RODBC', 'roxygen2', 'seqinr', 'sm', 'sp', 'sqldf', 'survey', | |
'WriteXLS', 'XML', 'xtable') | |
#We will install packages from the main CRAN site | |
repos = 'http://cran.r-project.org' | |
#Site provides some prebuilt binaries for Windows |
# Nothing to see here | |
shinyServer(function(input, output) { | |
}) |
stratified <- function(df, group, size, select = NULL, | |
replace = FALSE, bothSets = FALSE) { | |
if (is.null(select)) { | |
df <- df | |
} else { | |
if (is.null(names(select))) stop("'select' must be a named list") | |
if (!all(names(select) %in% names(df))) | |
stop("Please verify your 'select' argument") | |
temp <- sapply(names(select), | |
function(x) df[[x]] %in% select[[x]]) |
/** | |
* Get a random floating point number between `min` and `max`. | |
* | |
* @param {number} min - min number | |
* @param {number} max - max number | |
* @return {number} a random floating point number | |
*/ | |
function getRandomFloat(min, max) { | |
return Math.random() * (max - min) + min; | |
} |
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) { |
aPlotFunction <- function(hh, ss, sz){ | |
zp1 <- qplot(data = cars, x = dist, y = speed, | |
colour = I(hsv(hh/255, 1, 1)), | |
shape = I(ss), | |
size = I(sz)) | |
print(zp1 + theme_bw()) | |
} | |
manipulate( | |
aPlotFunction(hh, ss, sz), |
Download and install:
Download the dummy csv file from this gist ( https://gist.github.com/psychemedia/9690079 )
In RStudio run:
install.packages("shiny")
library(shiny) | |
library(dplyr) | |
library(lubridate) | |
# Load libraries and functions needed to create SQLite databases. | |
library(RSQLite) | |
library(RSQLite.extfuns) | |
saveSQLite <- function(data, name){ | |
path <- dplyr:::db_location(filename=paste0(name, ".sqlite")) |