neighbors: See the neighbors of a row in a data.frame

Description Usage Arguments Details Value Examples

View source: R/neighbors.R

Description

See the neighbors of a row in a data.frame

Usage

1
neighbors(x, row, surround = 3, colnum = 6)

Arguments

x

A data.frame to subset

row

The index of the row to see

surround

The number of rows around 'row' to see on each side. Default: 3

colnum

The number of columns to select. Default: 6

Details

This function is intended to provide a glimpse into the vicinity of a data.frame's row, returning the row in question, along with its surround previous and posterior neighboring rows.

Value

A data.frame

Examples

1
neighbors(iris, 50, surround = 2)

pedrostrusso/prlib documentation built on Jan. 17, 2019, 11:10 a.m.