Created
March 2, 2019 05:37
-
-
Save yutannihilation/db921cb0c9975e5b666c55bbe280b6cc to your computer and use it in GitHub Desktop.
double dispatch (c.f. https://adv-r.hadley.nz/s3.html#double-dispatch)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
date <- as.Date("2017-01-01") | |
integer <- 1L | |
c(date, integer) | |
#> [1] "2017-01-01" "1970-01-02" | |
c(integer, date) | |
#> [1] 1 17167 | |
`+`(date, integer) | |
#> [1] "2017-01-02" | |
`+`(integer, date) | |
#> [1] "2017-01-02" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment