utils_coerce_time_class {distantia} | R Documentation |
Coerces Vector to a Given Time Class
Description
Coerces Vector to a Given Time Class
Usage
utils_coerce_time_class(x = NULL, to = "POSIXct")
Arguments
x |
(required, vector of class Date or POSIXct) time vector to convert. Default: NULL |
to |
(required, class name) class to coerce |
Value
time vector
See Also
Other internal_time_handling:
utils_as_time()
,
utils_is_time()
,
utils_new_time()
,
utils_time_keywords()
,
utils_time_keywords_dictionary()
,
utils_time_keywords_translate()
,
utils_time_units()
Examples
x <- utils_coerce_time_class(
x = c("2024-01-01", "2024-02-01"),
to = "Date"
)
x
class(x)
x <- utils_coerce_time_class(
x = c("2024-01-01", "2024-02-01"),
to = "POSIXct"
)
x
class(x)
x <- utils_coerce_time_class(
x = c("2024-01-01", "2024-02-01"),
to = "numeric"
)
x
class(x)
[Package distantia version 2.0.2 Index]