Record times for Northern Ireland mountain running events

First thing first - install necessary packages if not already installed

rm(list = ls())

library(tidyverse)
library(dplyr)
library(ggplot2)

Now let us set the directory and get going

##Load the data
nihills <- read.csv(file = "nihills.csv")
str(nihills)
## 'data.frame':    23 obs. of  5 variables:
##  $ X    : chr  "Binevenagh" "Slieve Gullion" "Glenariff Mountain" "Donard & Commedagh" ...
##  $ dist : num  7.5 4.2 5.9 6.8 5 4.8 4.3 3 2.5 12 ...
##  $ climb: int  1740 1110 1210 3300 1200 950 1600 1500 1500 5080 ...
##  $ time : num  0.858 0.467 0.703 1.039 0.541 ...
##  $ timef: num  1.064 0.623 0.887 1.214 0.637 ...

Check for missing values

sum(is.na(nihills))
## [1] 0

Wow!! no missing values`.

summary(nihills)
##       X                  dist            climb           time       
##  Length:23          Min.   : 2.500   Min.   : 750   Min.   :0.3247  
##  Class :character   1st Qu.: 4.000   1st Qu.:1205   1st Qu.:0.4692  
##  Mode  :character   Median : 4.500   Median :1500   Median :0.5506  
##                     Mean   : 5.778   Mean   :2098   Mean   :0.8358  
##                     3rd Qu.: 5.800   3rd Qu.:2245   3rd Qu.:0.7857  
##                     Max.   :18.900   Max.   :8775   Max.   :3.9028  
##      timef       
##  Min.   :0.4092  
##  1st Qu.:0.6158  
##  Median :0.7017  
##  Mean   :1.1107  
##  3rd Qu.:1.0014  
##  Max.   :5.9856

According to the summary statistics - X is the name of the participant, Maximum distance covered is 18.9 units and minimum is 2.5 units. Climb starts from 750 units and the max altitude is 8775 units

As the climb increases, so is the time - believe me…

ggplot(nihills, aes(climb, timef)) +  geom_line(color="Brown") +ggtitle("Time to climb")+ theme(panel.background = element_blank()) +  theme(plot.title = element_text(hjust = 0.5))