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")
)
A vector representation of the data in decimal format--year and decimal fraction.
a vector of a valid date object, or character representation of dates. Missing values are permitted and produce corresponding missing values in the output.
a character representation of times. Missing values are permitted and produce corresponding missing values in the output.
format to convert times
. See Details.
format to convert dates
is character.
logical, if TRUE
and dates
is class "Date," then
set set the time to noon, otherwise no time adjustment is made. See Details.
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.
Added from smwrBase.
dectime("11/11/1918", date.format="%m/%d/%Y")
dectime(1988:1990)
Run the code above in your browser using DataLab