Skip to content

Instantly share code, notes, and snippets.

@romainfrancois
Created July 26, 2017 13:21
Show Gist options
  • Save romainfrancois/593e4920a1801dc45eb4d3854fa9a19a to your computer and use it in GitHub Desktop.
Save romainfrancois/593e4920a1801dc45eb4d3854fa9a19a to your computer and use it in GitHub Desktop.
library(tidyverse)
library(lubridate)
library(emoGG)
lexie <- tribble( ~date, ~weight,
"2017-07-12", 3.460,
"2017-07-13", 3.200,
"2017-07-14", 3.100,
"2017-07-15", 3.200,
"2017-07-16", 3.250,
"2017-07-17", 3.310,
"2017-07-18", 3.350,
"2017-07-26", 3.810
) %>%
mutate(
date = ymd(date),
jour = as.numeric(date-min(date))
)
ggplot( lexie, aes( x = date, y = weight) ) +
geom_line() +
geom_emoji(emoji="1f476") +
scale_x_date(
breaks = seq(min(lexie$date), max(lexie$date), by = "day" ),
labels = paste( "J", seq(0, max(lexie$date) - min(lexie$date) ) )
) +
scale_y_continuous(
breaks = seq(3.1, 4, by = .1)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment