2025-03-24

## Warning: package 'ggplot2' was built under R version 4.4.3
## Warning: package 'plotly' was built under R version 4.4.3
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
## Warning: package 'dplyr' was built under R version 4.4.3
## 
## 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

Slide 1 - “Mean, Median, & Mode of Lines of Code Written Per Day”

Slide 2 - My Introduction

As a computer science student, I measure my productivty by the number of lines of code that I write per day when I have a coding project to submit. This presentation explores the concepts of mean, median, and mode using a sample dataset of the lines of code written over the week.

Slide 3 - What exactly is Mean, Mode, & Median?

The mean is the average:

\[ \text{Mean} = \frac{\sum x_i}{n} \] \[ \text{Median} = \begin{cases} x_{\left(\frac{n+1}{2}\right)}, & \text{if } n \text{ is odd} \\ \frac{1}{2} \left( x_{\left(\frac{n}{2}\right)} + x_{\left(\frac{n}{2} + 1\right)} \right), & \text{if } n \text{ is even} \end{cases} \]

The median is the middle value after data is sorted.

Lastly, the mode is the most frequently occuring data point or value.

Slide 4 - My Data Over The Past Week

## [1] 120  90 130 107 140 230 130

Slide 5 - My Calculations - Mean, Mode, & Median

## [1] 135.2857
## [1] 130
## [1] 130

Slide 6 - My Histogram

Slide 7 - My Bar Plot of The Frequency

Slide 8 - My Plotly Plot

Slide 9 - My Code

ggplot(data.frame(loc), aes(x=loc)) + 
  geom_histogram(binwidth = 20, fill = "#8C1D40", color= "pink") +
  labs(title="Histogram of Lines of Code Per Day", x = "Lines of Code", y = "Frequency")