date_difftime_ {ThomasJeffersonUniv}R Documentation

Concatenate a Date and a difftime Object

Description

..

Usage

date_difftime_(date_, difftime_, tz = "UTC", tol = sqrt(.Machine$double.eps))

Arguments

date_

an R object containing Date information

difftime_

a difftime object

tz

character scalar, time zone, see as.POSIXlt.Date and ISOdatetime

tol

numeric scalar, tolerance in finding second. Default sqrt(.Machine$double.eps) as in all.equal.numeric

Value

Function date_difftime_ returns a POSIXct object.

Note

For now, I do not know how to force function readxl::read_excel to read a column as POSIXt. By default, such column will be read as difftime.

See lubridate:::date.default for the handling of year and month!

Examples

(x = as.Date(c('2022-09-10', '2023-01-01', NA, '2022-12-31')))
y = as.difftime(c(47580.3, NA, 48060, 30660), units = 'secs')
units(y) = 'hours'
y
date_difftime_(x, y)

[Package ThomasJeffersonUniv version 0.1.2 Index]