Generate a Fake POSIXct Column
Source:R/generate_fake_posixct_column.R
generate_fake_posixct_column.Rd
Create synthetic timestamps either by mimicking an existing POSIXct vector
(using its range and NA rate) or by sampling uniformly between start
and end
.
Usage
generate_fake_posixct_column(
like = NULL,
n = NULL,
start = NULL,
end = NULL,
tz = "UTC",
na_prop = NULL
)
Arguments
- like
Optional POSIXct vector to mimic. If supplied,
n
defaults tolength(like)
, the output range matchesrange(like, na.rm = TRUE)
, and the NA rate is copied unless you override withna_prop
.- n
Number of rows to generate. Required when
like
isNULL
.- start, end
Optional POSIXct bounds to sample between when
like
isNULL
.- tz
Timezone to use if
like
has notzone
(default "UTC").- na_prop
Optional NA proportion to enforce in the output (0–1). If
NULL
andlike
is provided, it copies the NA rate fromlike
. Iflike
isNULL
, defaults to 0.