
Generate a Fake POSIXct Column
Source:R/generate_fake_posixct_column.R
generate_fake_posixct_column.RdCreate 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,
ndefaults 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
likeisNULL.- start, end
Optional POSIXct bounds to sample between when
likeisNULL.- tz
Timezone to use if
likehas notzone(default "UTC").- na_prop
Optional NA proportion to enforce in the output (0–1). If
NULLandlikeis provided, it copies the NA rate fromlike. IflikeisNULL, defaults to 0.