hadley/lubridate — pull request #282 by juba (2014-12-11 14:45:03+00:00)
Title: Remove match.call() access to as.period() unit argument

The `unit` argument inside the `Interval` method for `as.period()` is accessed via `match.call()$unit`.
This makes it impossible to use inside another function, as `match.call()$unit` returns the symbol instead of the value.

For example, the following code throws an error as the `unit` argument inside `as.period()` is seen as a `myunit` symbol instead of a `"month"` character string :

f <- function(interval, myunit) {
as.period(interval, unit=myunit)
}

interv <- new_interval(as.Date("2000-01-01"), today())
f(interv, myunit="month")