Learn R Programming

phinterval (version 1.0.0)

hole: Create a hole phinterval

Description

hole() creates a <phinterval> vector where each element is a hole (an empty set of time spans).

Usage

hole(n = 1L, tzone = "")

Value

A <phinterval> vector of length n where each element is a <hole>.

Arguments

n

[integer(1)]

The number of hole elements to create. Must be a positive whole number.

tzone

[character(1)]

A time zone to display the <phinterval> in. Defaults to "".

Details

A hole is a phinterval element with zero time spans, representing an empty interval. Holes are useful as placeholders or for representing the absence of time periods in interval algebra operations.

Examples

Run this code
# Create a single hole
hole()

# Create multiple holes
hole(3)

# Specify time zone
hole(tzone = "UTC")

# Holes can be combined with other phintervals
jan <- phinterval(as.Date("2000-01-01"), as.Date("2000-02-01"))
c(jan, hole(), jan)

Run the code above in your browser using DataLab