Skip to contents

The boston_country() function uses the results_boston database to get information about countries that had representants in an edition of Boston Marathon from 2009 to 2022.

Usage

boston_country(gender, year, country)

Arguments

gender

Gender of the athlete (string).

year

Year when the event occured (string).

country

Country of origin of an athlete (string).

Value

A dataframe of 7 column with gender, year of event, country of origin of an athlete, number of finishers from that country, mean age of finishers, fastest time and slowest time.

Examples

boston_country(gender = "both", year = 2021:2022, country = c("Brazil", "Kenya"))
#> Warning: There was 1 warning in `dplyr::filter()`.
#>  In argument: `&...`.
#> Caused by warning in `CountryOfCtzName == country`:
#> ! longer object length is not a multiple of shorter object length
#> # A tibble: 8 × 7
#>   gender  year country_of_ctz_name n_athletes mean_age fastest_time slowest_time
#>   <chr>  <int> <chr>                    <int>    <dbl> <Period>     <Period>    
#> 1 Female  2022 Brazil                      53     44.6 3H 9M 17S    5H 48M 49S  
#> 2 Female  2022 Kenya                        6     32.3 2H 21M 1S    3H 44M 34S  
#> 3 Male    2022 Brazil                      95     46.6 2H 40M 14S   6H 23M 26S  
#> 4 Male    2022 Kenya                        4     34.2 2H 6M 51S    2H 31M 6S   
#> 5 Female  2021 Brazil                       8     45.1 3H 17M 4S    5H 27M 54S  
#> 6 Female  2021 Kenya                        5     33.6 2H 25M 9S    2H 38M 5S   
#> 7 Male    2021 Brazil                      12     43.8 2H 49M 43S   5H 55M 34S  
#> 8 Male    2021 Kenya                        7     32.6 2H 9M 51S    2H 28M 55S  
boston_country(gender = "Female", year = 2022, country = "Kenya")
#> # A tibble: 1 × 7
#>   gender  year country_of_ctz_name n_athletes mean_age fastest_time slowest_time
#>   <chr>  <int> <chr>                    <int>    <dbl> <Period>     <Period>    
#> 1 Female  2022 Kenya                        8     31.1 2H 21M 1S    3H 44M 34S  
boston_country(gender = "Male", year = 2009, country = "United States of America")
#> # A tibble: 1 × 7
#>   gender  year country_of_ctz_name n_athletes mean_age fastest_time slowest_time
#>   <chr>  <int> <chr>                    <int>    <dbl> <Period>     <Period>    
#> 1 Male    2009 United States of A…      10834     42.4 2H 9M 40S    7H 31M 36S