Skip to content

Instantly share code, notes, and snippets.

@strboul
Last active December 20, 2017 21:56
Show Gist options
  • Save strboul/14f22b20859a001c6fe83dfeb65b9c6a to your computer and use it in GitHub Desktop.
Save strboul/14f22b20859a001c6fe83dfeb65b9c6a to your computer and use it in GitHub Desktop.
days <- seq_along(1:365)
points <- list()
for (i in days) {
points[[i]] <- exp(-i/500)
}
x <- unlist(points)
df <- cbind.data.frame(x, days)
df <- data.frame(df)
colnames(df) <- c("Point","Day")
library(ggplot2)
library(magrittr)
df %>%
ggplot() +
geom_line(aes(x=Day, y=Point), stat="identity") +
scale_x_continuous(breaks=seq(0,365,50)) +
annotate("text", x = 241, y = 0.71, label = "x (170, 0.7046881)", color="blue") +
annotate("text", x = 175, y = 0.8, label = "x (90, 0.8352702)", color="blue") +
xlab('Day') +
ylab('Point')
@rctatman
Copy link

You should put this in a Kaggle kernel 😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment