inst/data_raw/Runners/add_id_to_Runners.R

# add a unique ID to each runner.
# This relies on the ordering of the original <Runners>
library(mosaicCalc)
# Runners is without ID.
load("Runners.rda")
#put an ID number
firsts <- Runners %>% filter(previous==0) %>% mutate(id = paste0("A", row_number()))

all_id <- with(firsts, rep(id, nruns))

Runners <- Runners %>% mutate(id = all_id)

# save(Runners, file="data/Runners.rda")

Try the mosaicCalc package in your browser

Any scripts or data that you put into this service are public.

mosaicCalc documentation built on June 22, 2024, 6:49 p.m.