Learn R Programming

index0 (version 0.0.1)

head.index0: Return the First or Last Parts of a Zero-Indexed Object

Description

Works like utils::head() and utils::tail().

Usage

# S3 method for index0
head(x, ...)

# S3 method for index0 tail(x, ...)

Arguments

x

An index0 object

...

Other arguments, passed to generic function

Value

An index0 object

Details

Just because an object is zero-indexed, doesn't mean that the definition of, for example, "the first 5 elements" or "the last two elements" has changed. Thus we add methods head() and tail() to ensure they behave as normal.