shide-coercion | R Documentation |
Double dispatch methods to support vctrs::vec_ptype2()
.
## S3 method for class 'jdate'
vec_ptype2(x, y, ..., x_arg = "", y_arg = "")
## S3 method for class 'jdatetime'
vec_ptype2(x, y, ..., x_arg = "", y_arg = "")
x , y |
Vector types. |
... |
These dots are for future extensions and must be empty. |
x_arg , y_arg |
Argument names for |
Coercion rules for jdate
and jdatetime
:
Combining a jdate
and jdatetime
yields a jdatetime
.
When combining two jdatetime
objects, the timezone is taken from the first non-local timezone.
An object prototype if x and y can be safely coerced to the same prototype;
otherwise it returns an error. See details for more information on
coercion hierarchy for jdate
and jdatetime
.
# jdate and jdatetime are compatible
c(jdate(), jdatetime(), jdatetime(tzone = "UTC"))
# jdate and Date are incompatible
try(c(jdate(), as.Date(NULL)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.