View source: R/field_yearmonth.R
dp_to_yearmonth | R Documentation |
Convert a vector to 'yearmonth' using the specified field descriptor
dp_to_yearmonth(x, fielddescriptor = list(), ...)
x |
the vector to convert. |
fielddescriptor |
the field descriptor for the field. |
... |
passed on to other methods. |
When fielddescriptor
is missing a default field descriptor is
generated.
Valid formats are "YYYY-MM" or "YYYYMM". When x is numeric or integer, it is assumed that it was a yearmonth in the format "YYYYMM" that was accidentally converted to numeric format.
Will return an Date
vector with fielddescriptor
added as the
'fielddescriptor' attribute. The dates will be the first of the given month.
Therefore, a 'yearmonth' "2024-05" is translated to a date "2024-05-01".
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.