shide-arithmetic | R Documentation |
jdate
and jdatetime
Arithmetic operations for jdate
and jdatetime
## S3 method for class 'jdate'
vec_arith(op, x, y, ...)
## S3 method for class 'jdatetime'
vec_arith(op, x, y, ...)
op |
An arithmetic operator as a string. |
x , y |
A pair of vectors. |
... |
These dots are for future extensions and must be empty. |
Supported operations:
Difference between two jdate
objects results a difftime
object with units = "days"
.
Difference between two jdatetime
objects results a difftime
object with units = "seconds"
.
A numeric vector can be added to or subtracted from a jdate
or jdatetime
.
A difftime
vector can be added to or subtracted from a jdate
only if it has
resolution bigger than "days".
A difftime
vector can be added to or subtracted from a jdatetime
.
A jdate
object can be subtracted from a jdatetime
and vice versa.
The binary operator result of x
and y
. See
details for more information on operator behaviors.
jdatetime_now() - jdate_now()
jdate_now() - as.difftime(1, units ="weeks" ) - as.difftime(1, units = "days")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.