Performs intersection (md_intersect()) and union (md_union()) on, inter alia, messy date class objects. For a more typical 'join' that retains all elements, even if duplicated, please use md_multiset.

e1 %intersect% e2

# S3 method for mdate
%intersect%(e1, e2)

e1 %union% e2

# S3 method for mdate
%union%(e1, e2)

Arguments

e1, e2

Messy date or other class objects

Value

A vector of the same mode for intersect, or a common mode for union.

Functions

  • %intersect% : Find intersection of sets of messy dates

  • %union% : Find intersection of sets of messy dates

Examples

as_messydate("2012-01-01..2012-01-20") %intersect% as_messydate("2012-01")
#>  [1] "2012-01-01" "2012-01-02" "2012-01-03" "2012-01-04" "2012-01-05"
#>  [6] "2012-01-06" "2012-01-07" "2012-01-08" "2012-01-09" "2012-01-10"
#> [11] "2012-01-11" "2012-01-12" "2012-01-13" "2012-01-14" "2012-01-15"
#> [16] "2012-01-16" "2012-01-17" "2012-01-18" "2012-01-19" "2012-01-20"
as_messydate("2012-01-01..2012-01-20") %union% as_messydate("2012-01")
#>  [1] "2012-01-01" "2012-01-02" "2012-01-03" "2012-01-04" "2012-01-05"
#>  [6] "2012-01-06" "2012-01-07" "2012-01-08" "2012-01-09" "2012-01-10"
#> [11] "2012-01-11" "2012-01-12" "2012-01-13" "2012-01-14" "2012-01-15"
#> [16] "2012-01-16" "2012-01-17" "2012-01-18" "2012-01-19" "2012-01-20"
#> [21] "2012-01-21" "2012-01-22" "2012-01-23" "2012-01-24" "2012-01-25"
#> [26] "2012-01-26" "2012-01-27" "2012-01-28" "2012-01-29" "2012-01-30"
#> [31] "2012-01-31"