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
<!doctype HTML> | |
<meta charset = 'utf-8'> | |
<html> | |
<head> | |
<link rel='stylesheet' href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css"> | |
<link rel='stylesheet' href='http://nvd3.org/assets/css/nv.d3.css'> | |
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js' type='text/javascript'></script> | |
<script src='http://d3js.org/d3.v3.min.js' type='text/javascript'></script> | |
<script src='http://timelyportfolio.github.io/rCharts_nvd3_tests/libraries/widgets/nvd3/js/nv.d3.min-new.js' type='text/javascript'></script> |
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
0.026474 | |
0.027401 | |
0.033266 | |
0.029264 | |
0.117353 | |
0.033074 | |
0.024319 | |
0.057596 | |
0.024865 | |
0.024960 |
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
## $* = filename without extension | |
## $@ = the output file | |
## $< = the input file | |
.SUFFIXES: .tex .pdf .Rnw .R | |
MAIN = lecture | |
INCLUDES = chapter1 chapter2 chapter3 | |
TEX = $(INCLUDES:=.tex) | |
RFILES = $(INCLUDES:=.R) |
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
--- | |
title: Checking Reveal.js | |
author: Ramnath Vaidyanathan | |
mode : selfcontained | |
framework: revealjs | |
hitheme : zenburn | |
revealjs: | |
theme: default | |
transition: none | |
center: "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
## Save as Server.R | |
library("shiny") | |
#x = USArrests | |
#save(x, file="/tmp/tmp.RData") | |
server = function(input, output){ | |
load("/tmp/tmp.RData") | |
output$table = output$table1 <- renderTable({x}) | |
} |
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
<div class="rmdnote"> | |
Some text | |
```{r} | |
1+1 | |
``` | |
</div> |
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
f = function(title="") { | |
set.seed(1) | |
par(mar=c(3,3,2,1), mgp=c(2,0.4,0), tck=-.01, | |
cex.axis=0.9, las=1) | |
plot(rnorm(100), rnorm(100), pch=21, bg="steelblue", | |
main=paste(title, "device"), | |
xlab="x-axis label", ylab="y-axis label", | |
xlim=c(-3,3), ylim=c(-3,3)) | |
text(0,3, | |
"Le français, c'est façile: Règles, Liberté, Egalité, Fraternité...", |
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
p_id = Sys.getpid() | |
cmd_mkl = paste("lsof -p", p_id, "| grep 'libmkl' | awk '{print $9}'") | |
out_mkl = try(system(cmd_mkl, intern = TRUE), silent = TRUE) | |
blas = out_mkl[grep("libmkl_core", out_mkl)] | |
lapack = out_mkl[grep("libmkl_intel_lp", out_mkl)] |
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
api = rtypeform::get_api(api_key) | |
url = paste0("https://api.typeform.com/v1/form/", uid, "?key=", api) | |
## Form the REST URL & query | |
url = paste0(url, rtypeform:::get_order_by(NULL)) | |
ua = httr::user_agent("https://github.com/csgillespie/rtypeform") | |
resp = httr::GET(url, ua) | |
cont = httr::content(resp, "text") | |
rtypeform:::check_api_response(resp) |
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(plotly) | |
library(reshape2) | |
compare_func_time = function(number = 1, N = 5000){ | |
df = data.frame(matrix(nrow = N, ncol = 11, data = c(rnorm(10*N,10), rnorm(N,30,10)))) | |
colnames(df) = paste0("dist", 1:11) | |
st1 = system.time({ | |
replicate(number, { | |
l = list() |
OlderNewer