#HTML presentation tools
There are many HTML presentation tools and they are all created for slightly different reasons. Here's an overview. Please let me know if I forgot any.
##CSSS
CSS-based SlideShow System
######################################################## | |
##### Author: Diego Valle Jones | |
##### Website: www.diegovalle.net | |
##### Date Created: Mon Mar 01 18:51:27 2010 | |
######################################################## | |
#1. For what foods are Americans and Mexicans outliers | |
#2. Partition the data around medoids to classify the | |
#countries of the world according to what they eat | |
library(ggplot2) |
plot.heat <- function(tmp,state.map,z,title=NULL,breaks=NULL,cex.legend=1,bw=.2,col.vec=NULL,main=NULL,plot.legend=TRUE, ...) { | |
tmp@data$zCat <- cut(tmp@data[,z],breaks,include.lowest=TRUE) | |
cutpoints <- levels(tmp@data$zCat) | |
if (is.null(col.vec)) col.vec <- heat.colors(length(levels(tmp@data$zCat))) | |
cutpointsColors <- col.vec | |
levels(tmp@data$zCat) <- cutpointsColors | |
cols <- as.character(tmp$zCat) | |
##cols <- "white" | |
plot(tmp,border=cols, lwd=bw,axes = FALSE, las = 1,col=as.character(tmp@data$zCat),main="A", ...) | |
if (!is.null(state.map)) { |
\documentclass{article} | |
<<hook-printfun, echo=FALSE>>= | |
knit_hooks$set(printfun = function(before, options, envir) { | |
if (before) return() | |
txt = capture.output(dump(options$printfun, '')) | |
## reformat if tidy=TRUE | |
if (options$tidy) txt = formatR::tidy.source(text = txt, output = FALSE)$text.tidy | |
con = textConnection(txt) | |
on.exit(close(con)) |
#!/usr/bin/env ruby | |
dry_run = ARGV.delete('--dry-run') | |
force = ARGV.delete('--force') | |
if ARGV.empty? | |
puts <<-USAGE | |
minify, swiftly concat and minify JavaScript files from the command line | |
Pass a single argument to create a .min.js version: |
The following document is a written account of the Code School screencasting framework. It should be used as a reference of the accompanying screencast on the topic.
You're probably aren't going to take the time to read this document if you're not interested, but there are a lot of nice side effects caused by learning how to create quality screencasts.
# watch all .Rmd files in a directory, if any change, knit them | |
library(knitr) | |
# use watch from Hadley's testthat package | |
library(testthat) | |
watchr<-function(path){ | |
# the path supplied here can just be something like "./" |
library(shiny) | |
# Sample database | |
patient <- data.frame(PatientID = LETTERS[1:5], | |
Name = letters[1:5],stringsAsFactors=FALSE) | |
record <- data.frame(PatientID = rep(patient$PatientID,3)) | |
record$RecordID <- paste(PatientID=patient$PatientID, | |
sample(LETTERS[1:26],15),sep="_") | |
record$Title <- sample(letters[1:26],15) |
# Here a set of instructions corresponding to each code lesson is made into a dataset codelist | |
ID=as.numeric() # id of code lesson | |
instruct=as.character() # instructions for code lesson | |
subhead=as.character() # subheading for code lesson | |
i=1 | |
ID[i]=i | |
subhead[i]="Simple R Expressions: Addition" | |
instruct[i]=paste('Try simple math','Type the command below','','1+1','',sep="\n") |
data_sets <- c("mtcars", "morley", "rock") | |
shinyServer(function(input, output) { | |
# Drop-down selection box for which data set | |
output$choose_dataset <- reactiveUI(function() { | |
selectInput("dataset", "Data set", as.list(data_sets)) | |
}) | |
# Check boxes |