Skip to content

Instantly share code, notes, and snippets.

@ChrisBeeley
Created November 3, 2021 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChrisBeeley/9177c59c8cd4f18959fb90ced7762e72 to your computer and use it in GitHub Desktop.
Save ChrisBeeley/9177c59c8cd4f18959fb90ced7762e72 to your computer and use it in GitHub Desktop.
---
title: "Parameterised Reporting"
author: "Tina Simms"
date: "03/11/2021"
output: html_document
params:
month:
label: "Month of the Year"
value: January
input: select
choices: [January, February, March, April]
---
```{r setup, include=FALSE}
knitr::opts_knit$set(root.dir = "../")
if (!require("pacman")) install.packages("pacman"); library(pacman)
p_load(tidyverse, lubridate, readxl, shiny)
```
### My Time of Access Viz
```{r, fig.width = 10}
dat <- read_xlsx("data/TOA_Data.xlsx")
dat %>%
group_by(Month, Hour_Start) %>%
summarise(count = sum(count, na.rm = T)) %>%
ggplot() +
geom_point(aes(x = as.numeric(Hour_Start), y = count, color = Month)) +
geom_line(aes(x = as.numeric(Hour_Start), y = count, color = Month, group = Month)) +
scale_x_continuous(breaks = seq(0,23,1)) +
theme_classic()
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment