filter_time: Filter Tennis Data on Time

Description Usage Arguments Details Value Examples

View source: R/time.R

Description

Return all matches in x that were played between two dates. Matches played on to or from are included in te returned data.

Usage

1
filter_time(x, from, to = from)

Arguments

x

A data frame from the tennis package.

from

A vector of length one that indicates the starting point. See Details.

to

A vector of length one that indicates the end point. See Details.

Details

The values for from and to are compared to the integer field tourney_date in x. When they are nonnumeric, for instance of class Date, they are cleaned and coerced to integer. from and to may contain less than eight characters, they will padded if necesarry.

Value

The subset in x of all the matches that were played between from and to.

Examples

1
2
3
4
5
6
7
8
9
# get all matches in 2016
filter_time(atp_matches, 2016)

# get all matches from tourneys that start in June 2016
filter_time(atp_matches, 201606)

# get all matches from tourneys started between
# June 2015 and May 2016
filter_time(atp_matches, "2015-06", "2016-05")

EdwinTh/tennis documentation built on Jan. 13, 2020, 2:38 p.m.