Skip to content

Instantly share code, notes, and snippets.

Created May 8, 2019 17:26
What would you like to do?
## Libraries we are going to need
## Load in the data set
vdecls <- readxl::read_xlsx("stramkurs.xlsx", col_types=c("date"))
## Fixup the data set, since Excel is utter crap. There are some NA values, get
## rid of those
vdecls <- filter(vdecls, !
## The name of the column is rather irritating, fixup
vdecls <- rename(vdecls, timestamp = ends_with("Kurs"))
## Kernel density
p <- ggplot(vdecls, aes(timestamp))
p + geom_density()
## Hours and weekdays are extracted so we can plot those
times <- vdecls %>%
mutate(hour = hour(timestamp),
wday = wday(timestamp, label=TRUE, abbr = TRUE))
p <- ggplot(times, aes(hour))
p + geom_histogram(stat="count")
p <- ggplot(times, aes(hour))
p + geom_histogram(stat="count") + facet_grid(rows = vars(wday))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment