date_to_integer: Convert Date to Integer

View source: R/check_helpers.R

date_to_integerR Documentation

Convert Date to Integer

Description

This function converts a date-like object (Date, character, factor, or numeric) to an integer representing the number of days since 1970-01-01. It handles various formats and returns NA_integer_ for NA inputs. It is used internally in the package to ensure consistent date handling.

Usage

date_to_integer(x)

Arguments

x

a date-like object (Date, character, factor, or numeric).

Value

an integer representing the date in days since 1970-01-01, or NA_integer_ if the input is NA.


piavat/PRE2DUP-R documentation built on June 11, 2025, 11:42 a.m.