Skip to content

Instantly share code, notes, and snippets.

@calderonsteven
Created September 13, 2013 00:08
Show Gist options
  • Select an option

  • Save calderonsteven/6545424 to your computer and use it in GitHub Desktop.

Select an option

Save calderonsteven/6545424 to your computer and use it in GitHub Desktop.
rm(list=ls())
path_to_dir <- "~/Dropbox/code/rnad-chiboha" # reset this
setwd(path_to_dir)
# libraries
# install this like so:
install.packages('plyr')
install.packages('makeR')
library('plyr')
library('makeR')
# read in data
#df <- read.csv("raw_data.csv", header=F, sep="\t")
# clean up
#df$V2 <- NULL
#df$V3 <- NULL
#df$V4 <- NULL
#names(df) <- c("id", "date", "dept_id", "dept_nombre", "municipio_id", "municipio_nombre", "area", "acc_desc", "type", "time", "obs")
# write clean data
df = read.csv(df, "clean_data.csv", row.names=FALSE)
# plot some things!
# calendar
day_count <- ddply(df, c('date'), function(x) {
return(data.frame(count=nrow(x)))
})
calendarHeat(day_count$date, day_count$count)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment