Skip to content

Instantly share code, notes, and snippets.

@rweald
Forked from anonymous/probability-of-wfh.R
Created December 17, 2012 17:43
Show Gist options
  • Save rweald/4320255 to your computer and use it in GitHub Desktop.
Save rweald/4320255 to your computer and use it in GitHub Desktop.
library(ggplot)
decay <- function (x, lambda = 5) {
return((100 * exp((-1 * lambda) * x)))
}
xs <- seq(from = 1, to = 10, by = 0.001)
ys <- sapply(xs, decay, lambda = 0.4)
xticks <- 1:10
yticks <- seq(from = 0, to = 100, by = 10)
png("~/Downloads/probability-of-wfh.png", width=1800, height=1600)
ggplot(data = NULL, aes(x = xs, y = ys)) + geom_path() +
labs(title = "Probability Ryan Will WFH", x = "Number of people in office",
y = "Probability of WFH") +
scale_x_continuous(breaks = xticks, labels = xticks) +
scale_y_continuous(breaks = yticks, labels = yticks)
dev.off()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment