dp_to_yearmonth {datapackage} | R Documentation |
Convert a vector to 'yearmonth' using the specified field descriptor
Description
Convert a vector to 'yearmonth' using the specified field descriptor
Usage
dp_to_yearmonth(x, fielddescriptor = list(), ...)
Arguments
x |
the vector to convert. |
fielddescriptor |
the field descriptor for the field. |
... |
passed on to other methods. |
Details
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.
Value
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".
[Package datapackage version 0.2.3 Index]