Skip to content

Instantly share code, notes, and snippets.

@stla
stla / d3test.html
Last active December 18, 2015 14:48
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="http://d3js.org/d3.v2.js?2.9.1"></script>
<style>
.link {
stroke: #666;
opacity: 0.6;
@stla
stla / index.html
Last active December 18, 2015 15:39
My Chart
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<script src='http://polychart.com/s/third_party/polychart2.standalone.js' type='text/javascript'></script>
<style>
.rChart {
display: block;
@stla
stla / index.html
Created June 18, 2013 16:56
TestFirefox1
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<script src='http://polychart.com/s/third_party/polychart2.standalone.js' type='text/javascript'></script>
<style>
.rChart {
display: block;
@stla
stla / index.html
Created June 18, 2013 17:05
TestFirefox2
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<script src='http://polychart.com/s/third_party/polychart2.standalone.js' type='text/javascript'></script>
<style>
.rChart {
display: block;
@stla
stla / kantorovich_v0.html
Last active December 18, 2015 23:29
Preliminary version of Kantorovich in R
<!DOCTYPE html>
<!-- saved from url=(0014)about:internet -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Using R to compute the Kantorovich distance </title>
<style type="text/css">
body, td {
@stla
stla / BS_v3.html
Last active December 21, 2015 05:38
Knitr output with a too long character string
<!DOCTYPE html>
<!-- saved from url=(0014)about:internet -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Introductory example: Euler&#39;s approximation of \( \pi \)</title>
<style type="text/css">
body, td {
@stla
stla / RStudioSlidesv0.html
Created September 8, 2013 19:27
Short RStudio presentation v0
<!DOCTYPE html>
<html>
<head>
<title>RStudio</title>
<meta charset="utf-8">
<meta name="description" content="RStudio">
<meta name="author" content="">
<meta name="generator" content="slidify" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
@stla
stla / server.R
Created September 10, 2013 19:25
How to use renderChart2() when the data file has not been uploaded yet ?
library(shiny)
library(rCharts)
library(data.table)
####
#### Server
####
shinyServer(function(input, output) {
##
## load data csv file
##
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<link rel='stylesheet' href='http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/css/jquery.dataTables.css'>
<script src='http://code.jquery.com/jquery-1.10.2.min.js' type='text/javascript'></script>
<script src='http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.min.js' type='text/javascript'></script>
<style>
@stla
stla / server.R
Last active December 22, 2015 20:19
Datatable with a plot - strange scroll bar
require(rCharts)
require(shiny)
require(data.table)
shinyServer(function(input, output, session){
output$myplot <- renderPlot({
gg <- ggplot(iris, aes(x=Sepal.Width, y=Sepal.Length)) + geom_point() + facet_grid(Species~.)
print(gg)
}, height=750)
output$mytable <- renderChart2({