dectime | R Documentation |
Convert date/time data to be expressed as year and fractional part of year. This can be useful for plotting or representing time in a regression model.
dectime(dates, times, time.format, date.format, Date.noon = TRUE, year.type = c("calendar", "water", "climate"))
dates |
a vector of a valid date object, or character representation of dates. Missing values are permitted and produce corresponding missing values in the output. |
times |
a character representation of times. Missing values are permitted and produce corresponding missing values in the output. |
time.format |
format to convert |
date.format |
format to convert |
Date.noon |
logical, if |
year.type |
a character string indicating the type of year to determine the offset, must be one of "calendar," "water," or "climate." |
The format for times
must be one of "hm," "hms," or "ms." Note that
this is actually a conversion function, see See Also. If times
is missing, dates
is class "Date," and Date.noon
is TRUE
,
then set the time to 12:00, so that the decimal time represents the center of
the day.
A vector representation of the data in decimal format–year and decimal fraction.
hm
, strptime
dectime("11/11/1918", date.format="%m/%d/%Y") dectime(1988:1990)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.