You have git repository with the following directory structure
myproject
|- source
|- docs
|- README.md
iclass <- function(x) { | |
c( | |
if (is.matrix(x)) "matrix", | |
if (is.array(x) && !is.matrix(x)) "array", | |
if (is.double(x)) "double", | |
if (is.integer(x)) "integer", | |
mode(x) | |
) | |
} |
```{r setup, echo = FALSE} | |
opts_knit$set(out.format = 'html') | |
opts_chunk$set(highlight = TRUE) | |
``` | |
# Slidify | |
超簡単スライド作成 | |
@kohske |
# We first start by creating a way of escaping the characters that have special | |
# meaning for html, while making sure we don't end up double-escaping at any | |
# point. The easiest way to do this is to create an S3 class that allows us to | |
# distinguish between regular text (that needs escaping) and html (that | |
# doesn't). | |
# | |
# We then write an escape method that leaves html unchanged and escapes the | |
# special characters (&, <, >) in ordinary text. We also add a method for lists | |
# for convenience |
# A tutorial navigates through a series of states, either manually, with | |
# nxt(), prv(), jmp() etc, or automatically, by using addTaskCallback() and | |
# checking that preconditions are met. | |
# | |
# Each state has: | |
# * a message | |
# * a next state (a function name) | |
# (eventually may have multiple next named states) | |
# * an auto test | |
# |
to_json = function(df, orient = "columns", json = T){ | |
dl = as.list(df) | |
dl = switch(orient, | |
columns = dl, | |
records = do.call('zip_vectors_', dl), | |
values = do.call('zip_vectors_', setNames(dl, NULL)) | |
) | |
if (json){ | |
dl = rjson::toJSON(dl) | |
} |
library(shiny) | |
library(ggplot2) | |
# Download DataTables JS file and TableTools full package from http://datatables.net/download/ | |
# Change the paths appropriately: | |
addResourcePath('datatables','/Users/yourusername/Downloads/DataTables-1.9.4/media') | |
addResourcePath('tabletools','/Users/yourusername/Downloads/TableTools-2.1.5/media') | |
runApp(list( | |
ui = basicPage( |
## http://polygraph.cool/films/ | |
## https://github.com/matthewfdaniels/scripts | |
x <- "https://raw.githubusercontent.com/matthewfdaniels/scripts/master/data/character_list5.csv" | |
characters <- read.csv(x, na.strings = c("NULL", "?"), | |
fileEncoding = "ISO-8859-1", stringsAsFactors = FALSE) | |
## some ages are clearly (negative) birth years ... oops | |
characters$age[!is.na(characters$age) & characters$age < 0] <- NA | |
characters$age[!is.na(characters$age) & characters$age > 105] <- NA |
Best viewed in its own window (because I haven't set up the CSS properly yet).
This is a report to enable my clinicians to easily review clinic statistics at will. Click on rows in the table to plot that statistic; click again to remove it from the plot.
Very much a work in progress, so please feel free to heap on the feedback!
Built with the rampantly awesome D3.js.
license: gpl-3.0 |