| as_years_durationy | R Documentation |
durationy to duration in yearsConverts a durationy to its duration measured in years.
as.numeric() is the same as as.double().
as.integer() obtains the integer part as an integer, e.g.
as.integer(durationy(1.75)) is 1
and as.integer(durationy(-1.75)) is -1 (i.e. rounding towards 0).
It is also the case that if x is a durationy then
as.integer(x) is the same as as.integer(as.double(x)).
## S3 method for class 'durationy'
as.double(x, ...)
## S3 method for class 'durationy'
as.integer(x, ...)
x |
The |
... |
Not used. |
A vector of double.
durationy, as_years_datey, ops
d <- durationy(1.75)
d # 1.75 yr
as.double(d) # 1.75
as.numeric(d) # 1.75
as.integer(d) # 1
as.integer(-d) # -1
identical(as.integer(d), 1L) # TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.