Skip to content

Instantly share code, notes, and snippets.

@so-c
Last active December 11, 2015 09:19
Show Gist options
  • Save so-c/4579548 to your computer and use it in GitHub Desktop.
Save so-c/4579548 to your computer and use it in GitHub Desktop.
Moleskineを1冊使い切る日数。
library("ggplot2")
p# acquire
# 下記形式のinterval.csvから日付を取得
# "number","start","end"
# "1","2013-1-1","2013-1-31"
interval <- read.csv(file="interval.csv", as.is=TRUE)
# parse
interval$start <- as.Date(interval$start)
interval$end <- as.Date(interval$end)
# filter
# nothing
# mine
date.diff <- as.numeric(interval$end - interval$start)
interval <- cbind(interval, date.diff)
# represent
p <- ggplot(interval, aes(x=number, y=date.diff))
p <- p + geom_boxplot() + geom_jitter(aes(size=2))
p <- p + labs(x="", y="使用日数")
p <- p + theme(legend.position = "none")
p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment