2025-09-15

OVERVIEW

This presentation shows an interactive plot created with the package Plotly in R.

Specifically, the plot shows the percentiles of time for the Mexico City Half Marathon 2025. This result is showed by gender.

  • The data is not managed in this presentation because this is not its objective. All the raw data is available in the official site of the Half marathon, and the manage data is my own work.

DATA

Read the data., To see all the process to get the data, visit my Github page (in Spanish) where I have all the process.

data_quantil <- read_csv("data_quantil.csv",show_col_types = FALSE )
## New names:
## • `` -> `...1`
data_quantil$genero <- ifelse(data_quantil$genero == "Hombres",
                              "Men", "Women")

PLOT CODE

plot <- plot_ly( data_quantil, x = ~quantiles_secs,  
                 y = ~quantiles_id,
  color = ~genero,
  type = 'scatter',
  mode = 'markers', colors = c("#fb8072", "#8dd3c7")) %>%
  layout(title = list(text = " <b> Percentiles of time by gender <b>",
                      y = 0.99, x = 0.5 ),
         xaxis = list(title = "Time (hh:mm:ss)",  
                      tickformat = "%H:%M:%S" ), 
         yaxis = list(title = "Percentile"), 
        legend = list(title=list(text='Gender')))

PLOT