Skip to content

Instantly share code, notes, and snippets.

View prabhasp's full-sized avatar

Prabhas Pokharel prabhasp

View GitHub Profile
@prabhasp
prabhasp / _.md
Created June 17, 2013 15:04
pnc-schedules
@prabhasp
prabhasp / _.md
Created June 17, 2013 07:29
pnc-schedules
@prabhasp
prabhasp / index.Rmd
Last active December 14, 2015 22:09
Bamboo Benchmarks
<p><link href="http://kevinburke.bitbucket.org/markdowncss/markdown.css" rel="stylesheet"></link></p>
Analyzing bamboo bechmarks--2013/3/13
=====================================
Please refer to the generating index.Rmd file if you want to look at the code that generated this file. It should be in the same folder as index.html (which you are seeing now); most R code will be hidden for prettiness.
```{r warning=FALSE, message=FALSE, echo=FALSE}
library(lubridate)
library(reshape2)
library(ggplot2)
library(plyr)
# Read in data
@prabhasp
prabhasp / gist:5155863
Created March 13, 2013 20:32
Massaging (a folder full of) NPC xls files into a manageable localities subset
setwd("~/Dropbox/FINAL CONPEDIUM OF LOCALITIES/")
require(gdata)
l <- list.files()
l <- l[which(str_detect(l, "\\.xls"))]
listofdfs <- llply(l, function(fname) {
print(paste("Reading file:", fname))
tryCatch({
d <- read.xls(fname)
@prabhasp
prabhasp / index.Rmd
Last active December 14, 2015 12:18
Power Law Checks from formhub top-100 users
We'll be checking whether the top 100 users of formhub follow a power law distribution, or a log-normal distribution, using guidance from [a blog post by CMU stats prof. Cosma Rohilla Shaliz](http://vserver1.cscs.lsa.umich.edu/~crshalizi/weblog/857.html).
First, load up the dataset; I have included it here in case you want to re-produce it. Each value is a number of submissions on formhub for top 100 users.
```{r}
source("~/Downloads/pli-R-v0.0.3-2007-07-25/pareto.R")
source("~/Downloads/pli-R-v0.0.3-2007-07-25/lnorm.R")
source("~/Downloads/pli-R-v0.0.3-2007-07-25/power-law-test.R")
users <- c(220346L, 31099L, 28568L, 16573L, 14862L, 7531L, 6510L, 6138L,
@prabhasp
prabhasp / index.html
Last active April 18, 2017 14:12
Nepal Choropleths Example
<!DOCTYPE html>
<!-- saved from url=(0014)about:internet -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>How to make choropleth maps with R</title>
<style type="text/css">
body, td {
@prabhasp
prabhasp / unnamed-chunk-1.png
Last active December 11, 2015 02:19
Coverage analysis for Nigeria -- generated by Rmarkdown.
unnamed-chunk-1.png