Skip to content

Instantly share code, notes, and snippets.

@s-u
s-u / part1.R
Created May 15, 2014 22:40 — forked from smschauhan/part1.R
crowdsourced locations
load("~/geo.RData")
@s-u
s-u / mtcars.csv
Created May 15, 2014 22:41 — forked from smschauhan/mtcars.csv
mtcars - asset
mpg cyl disp hp drat wt qsec vs am gear carb
Mazda RX4 21 6 160 110 3.9 2.62 16.46 0 1 4 5
Mazda RX4 Wag 21 6 160 110 3.9 2.875 17.02 0 1 4 5
Datsun 710 22.8 4 108 93 3.85 2.32 18.61 1 1 4 1
Hornet 4 Drive 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1
Hornet Sportabout 18.7 8 360 175 3.15 3.44 17.02 0 0 3 2
Valiant 18.1 6 225 105 2.76 3.46 20.22 1 0 3 1
Duster 360 14.3 8 360 245 3.21 3.57 15.84 0 0 3 4
Merc 240D 24.4 4 146.7 62 3.69 3.19 20 1 0 4 2
Merc 230 22.8 4 140.8 95 3.92 3.15 22.9 1 0 4 2
@s-u
s-u / part1.md
Created May 15, 2014 22:41 — forked from smschauhan/part1.md
rCharts - demo

rCharts in rCloud

This is a demo of using rCharts along with rCloud. It requires installation of rCharts >= 0.4.2 and the latest version of rCloud.

Our first step is to load rCharts and set the appropriate options so that the charts are rendered as inline iframes.

library(rCharts)
options(
@s-u
s-u / part1.md
Created May 15, 2014 22:42 — forked from smschauhan/part1.md
rCharts - leaflet - demo

RCharts - Loading maps with different tiles

This notebook is an elementary example of how one can load a map with center at lat, long and a specific zoom. The first cell is mandatory and should not be modified, apart from the height and width parameters.

Due to an RCloud bug(will be fixed pretty soon), please load only one map per markdown cell - just as the example below.

# Always have this code on the top
library(rCharts)
options(
@s-u
s-u / part10.R
Created May 15, 2014 22:43 — forked from smschauhan/part10.R
wDCPlot with mtcars
# We don't want a numeric vector. We want a data.frame slice.
head(mtcars["mpg"])
@s-u
s-u / part2.md
Created May 15, 2014 22:46 — forked from smschauhan/part2.md
Markdown Basics

Here's what Raw Markdown Looks Like:

# Markdown Basics

This is plain text. Empty lines are interpreted as new paragraphs. Single newlines
are ignored by the markdown renderer.

## Code Samples

If you'd like to include code samples in your markdown, indent each line with
@s-u
s-u / part6.R
Created May 15, 2014 22:46 — forked from smschauhan/part6.R
Graphics
demo(graphics, ask=F)
@s-u
s-u / part2.md
Created June 19, 2014 08:06 — forked from smschauhan/part2.md
Markdown Basics

Here's what Raw Markdown Looks Like:

# Markdown Basics

This is plain text. Empty lines are interpreted as new paragraphs. Single newlines
are ignored by the markdown renderer.

## Code Samples

If you'd like to include code samples in your markdown, indent each line with
@s-u
s-u / cache.sh
Last active August 29, 2015 14:04
Cache external dependencies in rCharts
#!/bin/sh
#
# Usage: cache.sh [<prefix>]
#
# This file is intended to be run in the rCharts source
# root. It will plow through rCharts sources and
# pick out all external dependencies, download them
# with cache-* prefix as files and modify .yml
# files to reference them instead of the originals.
# All original .yml files are kept as .yml.orig
@s-u
s-u / mmap_alloc.c
Created October 22, 2014 15:21
example of using custom mmap allocator in R
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <unistd.h>
#include <fcntl.h>
#include <Rinternals.h>
#include <R_ext/Rallocators.h>
static void *mmap_alloc(R_allocator_t *allocator, size_t length) {