Learn R Programming

rphast (version 1.6.9)

split.feat: Split features by length

Description

Split features by length

Usage

# S3 method for feat
split(x, f, drop = FALSE, start.from = "left",
  pointer.only = FALSE, ...)

Arguments

x

An object of type feat

f

The maximum length of features in new object. Can be a vector giving a different length for each row, or a single numeric value. Values will be recycled to the same length as nrow.feat(x).

drop

A logical value saying whether to drop "left-over" elements which do not have exactly length f.

start.from

A character string, current valid values are "left" (start split at smallest coordinate for each feature), or "right" (start splitting at the last coordinate and work down). Values will be recycled to the length of nrow.feat(x)

pointer.only

If TRUE, return an object which is a pointer to a features object stored in C (advanced use only).

...

Currently not used (for S3 compatibility).

Value

An object of type feat with the same features as x but with all features of length > max.length broken into segments (starting from the first position in feature). The last piece of each split segment may be smaller than max.length