Swim_Parse {SwimmeR} | R Documentation |
Formats swimming and diving data read with read_results
into a data
frame
Description
Takes the output of read_results
and cleans it, yielding a data frame
of swimming (and diving) results
Usage
Swim_Parse(
file,
avoid = NULL,
typo = typo_default,
replacement = replacement_default,
format_results = TRUE,
splits = FALSE,
split_length = 50,
relay_swimmers = FALSE
)
swim_parse(
file,
avoid = NULL,
typo = typo_default,
replacement = replacement_default,
format_results = TRUE,
splits = FALSE,
split_length = 50,
relay_swimmers = FALSE
)
Arguments
file |
output from |
avoid |
a list of strings. Rows in |
typo |
a list of strings that are typos in the original results.
|
replacement |
a list of fixes for the strings in |
format_results |
should the results be formatted for analysis (special
strings like |
splits |
either |
split_length |
either |
relay_swimmers |
either |
Value
returns a data frame with columns Name
, Place
,
Age
, Team
, Prelims
, Finals
,
Points
, Event
& DQ
. Note all swims will have a
Finals
, even if that time was actually swam in the prelims
(i.e. a swimmer did not qualify for finals). This is so that final results
for an event can be generated from just one column.
See Also
swim_parse
must be run on the output of
read_results
Examples
## Not run:
swim_parse(read_results("http://www.nyhsswim.com/Results/Boys/2008/NYS/Single.htm", node = "pre"),
typo = c("-1NORTH ROCKL"), replacement = c("1-NORTH ROCKL"),
splits = TRUE,
relay_swimmers = TRUE)
## End(Not run)
## Not run:
swim_parse(read_results("inst/extdata/Texas-Florida-Indiana.pdf"),
typo = c("Indiana University", ", University of"), replacement = c("Indiana University", ""),
splits = TRUE,
relay_swimmers = TRUE)
## End(Not run)