# NOT RUN {
# Monthly counts across sensors ----
monthly_ped <- pedestrian %>%
group_by(Sensor) %>%
index_by(Year_Month = yearmonth(Date_Time)) %>%
summarise(
Max_Count = max(Count),
Min_Count = min(Count)
)
monthly_ped
index(monthly_ped)
# Using existing variable ----
pedestrian %>%
group_by(Sensor) %>%
index_by(Date) %>%
summarise(
Max_Count = max(Count),
Min_Count = min(Count)
)
# Annual trips by Region and State ----
tourism %>%
index_by(Year = lubridate::year(Quarter)) %>%
group_by(Region, State) %>%
summarise(Total = sum(Trips))
# }
Run the code above in your browser using DataLab