tf_parse: Parses track and field data from Flash or Hytek format data...

Description Usage Arguments Value See Also Examples

View source: R/tf_parse.R

Description

Outputs a data frame containing track and field data

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
tf_parse(
  file,
  avoid = avoid_default,
  typo = typo_default,
  replacement = replacement_default,
  relay_athletes = FALSE,
  rounds = FALSE,
  round_attempts = FALSE,
  split_attempts = FALSE,
  splits = FALSE,
  split_length = 1
)

Arguments

file

a .pdf or .html file (could be a url) where containing track and field results. Must be formatted in a "normal" fashion - see vignette

avoid

a list of strings. Rows in file containing these strings will not be included. For example "Record:", often used to label records, could be passed to avoid. The default is avoid_default, which contains many strings similar to "Record:". Users can supply their own lists to avoid.

typo

a list of strings that are typos in the original results. tf_parse is particularly sensitive to accidental double spaces, so "Central High School", with two spaces between "Central" and "High" is a problem, which can be fixed. Pass "Central High School" to typo.

replacement

a list of fixes for the strings in typo. Here one could pass "Central High School" (one space between "Central" and "High") to fix the issue described in typo

relay_athletes

should tf_parse try to include the names of relay athletes for relay events? Names will be listed in new columns "Relay-Athlete_1", "Relay_Athlete_2" etc. Defaults to FALSE.

rounds

should tf_parse try to include rounds for jumping/throwing events? Please note this will add a significant number of columns to the resulting data frame. Defaults to FALSE.

round_attempts

should tf_parse try to include rounds results (i.e. "PASS", "X", "O") for high jump and pole value events? Please note this will add a significant number of columns to the resulting data frame. Defaults to FALSE

split_attempts

should tf_parse split attempts from each round into separate columns? For example "XXO" would result in three columns, one for "X', another for the second "X" and third for "O". There will be a lot of columns. Defaults to FALSE

splits

either TRUE or the default, FALSE - should tf_parse attempt to include splits.

split_length

either the distance at which splits are collected (must be constant distance) or the default, 1, the length of track at which splits are recorded. Not all results are internally consistent on this issue. If in doubt use the default 1

Value

a data frame of track and field results

See Also

tf_parse is meant to be preceded by read_results

Examples

1
2
3
4
5
tf_parse(
read_results("https://www.flashresults.com/2018_Meets/Outdoor/05-05_A10/015-1.pdf"),
rounds = TRUE,
round_attempts = TRUE,
split_attempts = TRUE)

JumpeR documentation built on Nov. 17, 2021, 1:07 a.m.