checkTimeFormat {googlePublicData} | R Documentation |
DSPL time format verification
Description
Checks if a string fulfills the joda-times class specifications supported by DSPL language.
Usage
checkTimeFormat(fmt)
Arguments
fmt |
String representing a time format to be verified. |
Details
Public Data Explorer currently supports daily, monthly and yearly distributed data. Joda-time, the corresponding time format on which DSPL times is based, allows declaring time formats using small case "d" (for days), capitalized "M" (for months) and small case "y" for years. Some examples:
Format Specification | Data Example |
"yyyy" | 1988 |
"yyyy-MM" | 1988-03 |
"yyyy-MMM" | 1988-Mar |
"dd-MM-yyyy" | 02-03-1988 |
Value
Logical. TRUE
if the string passes the test.
Author(s)
George G. Vega Yon
References
Google Public Data Explorer DSPL time definition: https://developers.google.com/public-data/docs/canonical/time?hl=es
Google Public Data Explorer Cookbook for time definitions: https://developers.google.com/public-data/docs/cookbook#time_recipes
Joda Time 2.1 API: http://joda-time.sourceforge.net/api-release/org/joda/time/format/DateTimeFormat.html
See Also
See also dspl
Examples
checkTimeFormat("yyyy-MM") # TRUE
checkTimeFormat("MMMyyyy") # TRUE
checkTimeFormat("mmmyyyy") # FALSE