The full set of runners for the Big Sur marathon.

This data set has ~40k observations. Marathon website - https://www.bigsurmarathon.org/
marathon
Author

DS 150

Published

January 25, 2024

Data details

There are 39,009 rows and 20 columns. The data source1 is used to create our data that is stored in our pins table. You can access this pin from a connection to posit.byui.edu using hathawayj/marathon_big_sur.

This data is available to all.

Variable description

  • age The age of the runner
  • gender The gender of the runner (M/F)
  • chiptime The time in minutes for the runner
  • year The year of the marathon
  • marathon The name of the marathon
  • country The country where the marathon was held
  • finishers The number of finishers at the marathon

Variable summary

Variable type: numeric

skim_variable n_missing complete_rate mean sd p0 p25 p50 p75 p100 hist
age 3100 0.92 40.16 10.57 9.00 32.00 40.00 48.00 80.00 ▁▇▇▃▁
split_half 37434 0.04 117.32 12.09 73.17 109.13 118.45 126.77 159.72 ▁▃▇▅▁
clocktime 11546 0.70 271.99 42.12 141.72 240.38 270.20 301.57 407.87 ▁▅▇▅▁
chiptime 0 1.00 266.89 39.79 138.08 237.55 265.57 295.22 406.73 ▁▅▇▃▁
year 0 1.00 2006.68 3.88 2000.00 2003.00 2007.00 2010.00 2013.00 ▆▇▆▇▇
split_10k 39009 0.00 NaN NA NA NA NA NA NA
split_30k 39009 0.00 NaN NA NA NA NA NA NA
split_40k 39009 0.00 NaN NA NA NA NA NA NA
finishers 0 1.00 2866.06 437.48 1654.00 2517.00 2877.00 3246.00 3452.00 ▁▁▇▇▇
meantime 0 1.00 266.89 7.82 239.18 263.94 265.99 274.12 276.10 ▁▁▂▇▇
female 1 1.00 0.41 0.49 0.00 0.00 0.00 1.00 1.00 ▇▁▁▁▆
us 0 1.00 1.00 0.00 1.00 1.00 1.00 1.00 1.00 ▁▁▇▁▁
canada 0 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 ▁▁▇▁▁
europe 0 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 ▁▁▇▁▁
other 0 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 ▁▁▇▁▁
age_gender 0 1.00 0.92 0.27 0.00 1.00 1.00 1.00 1.00 ▁▁▁▁▇

Variable type: character

skim_variable n_missing complete_rate min max empty n_unique whitespace
gender 1 1 1 1 0 2 0
marathon 0 1 16 16 0 1 0
country 0 1 2 2 0 1 0
marathon2 0 1 21 21 0 14 0
Explore generating code using R
pacman::p_load(pins, tidyverse, downloader, fs, glue, rvest, googledrive, connectapi)


# Data is from master_marathon. 
sdrive <- shared_drive_find("byuids_data") # This will ask for authentication.
google_file <- drive_ls(sdrive)  |>
  filter(stringr::str_detect(name, "master_marathon"))
tempf <- tempfile()
drive_download(google_file, tempf)
dat <- read_csv(tempf)



# Filter to only the Big Sur Marathon
marathon_big_sur <- dat %>%
  filter(marathon == "Big Sur Marathon")



board <- board_connect()
pin_write(board, marathon_big_sur, type = "parquet")

pin_name <- "marathon_big_sur"
meta <- pin_meta(board, paste0("hathawayj/", pin_name))
client <- connect()
my_app <- content_item(client, meta$local$content_id)
set_vanity_url(my_app, paste0("data/", pin_name))

Access data

This data is available to all.

Direct Download: marathon_big_sur.parquet

R and Python Download:

URL Connections:

For public data, any user can connect and read the data using pins::board_connect_url() in R.

library(pins)
url_data <- "https://posit.byui.edu/data/marathon_big_sur/"
board_url <- board_connect_url(c("dat" = url_data))
dat <- pin_read(board_url, "dat")

Use this custom function in Python to have the data in a Pandas DataFrame.

import pandas as pd
import requests
from io import BytesIO

def read_url_pin(name):
  url = "https://posit.byui.edu/data/" + name + "/" + name + ".parquet"
  response = requests.get(url)
  if response.status_code == 200:
    parquet_content = BytesIO(response.content)
    pandas_dataframe = pd.read_parquet(parquet_content)
    return pandas_dataframe
  else:
    print(f"Failed to retrieve data. Status code: {response.status_code}")
    return None

# Example usage:
pandas_df = read_url_pin("marathon_big_sur")

Authenticated Connection:

Our connect server is https://posit.byui.edu which you assign to your CONNECT_SERVER environment variable. You must create an API key and store it in your environment under CONNECT_API_KEY.

Read more about environment variables and the pins package to understand how these environment variables are stored and accessed in R and Python with pins.

library(pins)
board <- board_connect(auth = "auto")
dat <- pin_read(board, "hathawayj/marathon_big_sur")
import os
from pins import board_rsconnect
from dotenv import load_dotenv
load_dotenv()
API_KEY = os.getenv('CONNECT_API_KEY')
SERVER = os.getenv('CONNECT_SERVER')

board = board_rsconnect(server_url=SERVER, api_key=API_KEY)
dat = board.pin_read("hathawayj/marathon_big_sur")