library(readxl)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(ggplot2)
library(lubridate)
##
## Attaching package: 'lubridate'
## The following objects are masked from 'package:base':
##
## date, intersect, setdiff, union
data <- read.csv("C:/Users/nika/Downloads/Daily Activity Data 2025(Data).csv")
data$SessionDate <- as.Date(data$`Session.Date`, format = "%m/%d/%Y")
data$WeekStart <- floor_date(data$SessionDate, "week")
play_sessions <- data %>%
filter(grepl("play", `Session.Type`, ignore.case = TRUE)) %>%
group_by(WeekStart) %>%
summarise(Count = n()) %>%
arrange(WeekStart) %>%
mutate(WeekNumber = row_number())
ggplot(play_sessions, aes(x = WeekNumber, y = Count)) +
geom_line(color = "steelblue", size = 1.2) +
geom_point(color = "steelblue", size = 3) +
labs(
title = "Play Sessions Week Over Week",
x = "Week",
y = "Number of Play Sessions"
) +
theme_minimal() +
theme(
plot.title = element_text(hjust = 0.5, size = 16, face = "bold")
) +
scale_x_continuous(breaks = play_sessions$WeekNumber)
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.

lesson_totals <- data %>%
filter(grepl("lesson", `Session.Type`, ignore.case = TRUE)) %>%
group_by(Coach) %>%
summarise(Total = n()) %>%
arrange(desc(Total))
ggplot(lesson_totals, aes(x = reorder(Coach, Total), y = Total)) +
geom_bar(stat = "identity", fill = "steelblue") +
coord_flip() +
labs(
title = "Total Lessons by Coach",
x = "Coach",
y = "Total Number of Lessons"
) +
theme_minimal() +
theme(
plot.title = element_text(hjust = 0.5, size = 16, face = "bold")
) +
geom_text(aes(label = Total), hjust = -0.3, size = 3.5)

non_play_sessions <- data %>%
filter(!grepl("play", `Session.Type`, ignore.case = TRUE)) %>%
group_by(`Session.Type`) %>%
summarise(Count = n()) %>%
arrange(desc(Count))
ggplot(non_play_sessions, aes(x = reorder(`Session.Type`, Count), y = Count)) +
geom_bar(stat = "identity", fill = "coral") +
coord_flip() +
labs(
title = "Non-Play Sessions Ordered by Popularity",
x = "Session Type",
y = "Number of Sessions"
) +
theme_minimal() +
theme(
plot.title = element_text(hjust = 0.5, size = 16, face = "bold")
) +
geom_text(aes(label = Count), hjust = -0.3, size = 3.5)
