Skip to contents

The boston_summary() function uses the results_boston database to get stats about the participants of a certain edition of Boston Marathon from 2009 to 2022.

Usage

boston_summary(gender, year)

Arguments

gender

Gender of the athlete (string).

year

Year when the event occured (string).

Value

A dataframe of 7 column with gender, year of event, number of finishers, mean age of finishers, number of countries that had representants in the event, fastest time (champion) and slowest time.

Examples

boston_summary(gender = "Male", year = 2021:2022)
#> # A tibble: 2 × 7
#>   gender  year n_finishers mean_age n_countries fastest_time slowest_time
#>   <chr>  <int>       <int>    <dbl>       <int> <Period>     <Period>    
#> 1 Male    2022       14262     45.0         107 2H 6M 51S    7H 24M 39S  
#> 2 Male    2021        7942     46.7          86 2H 9M 51S    7H 51M 35S  
boston_summary(gender = "Female", year = 2021)
#> # A tibble: 1 × 7
#>   gender  year n_finishers mean_age n_countries fastest_time slowest_time
#>   <chr>  <int>       <int>    <dbl>       <int> <Period>     <Period>    
#> 1 Female  2021        7444     43.0          64 2H 24M 45S   7H 33M 22S  
boston_summary(gender = "both", year = c(2009, 2021:2022))
#> # A tibble: 6 × 7
#>   gender  year n_finishers mean_age n_countries fastest_time slowest_time
#>   <chr>  <int>       <int>    <dbl>       <int> <Period>     <Period>    
#> 1 Female  2022       10572     41.4          84 2H 21M 1S    6H 49M 43S  
#> 2 Male    2022       14262     45.0         107 2H 6M 51S    7H 24M 39S  
#> 3 Female  2021        7444     43.0          64 2H 24M 45S   7H 33M 22S  
#> 4 Male    2021        7942     46.7          86 2H 9M 51S    7H 51M 35S  
#> 5 Female  2009        9298     38.0          54 2H 32M 16S   7H 16M 3S   
#> 6 Male    2009       13545     43.0          70 2H 8M 42S    7H 31M 36S