around: View values around an index

Description Usage Arguments Value Author(s) See Also Examples

View source: R/around.R

Description

View index rows of a data.frame with n surrounding rows

Usage

1
around(x, i, n1 = 2, n2 = n1, convert = is.logical(i))

Arguments

x

Data.frame

i

Index (logical or integers)

n1

Number of elements shown before each i. DEFAULT: 2

n2

Number of elements shown after each i. DEFAULT: n1

convert

Use which to get the row numbers? DEFAULT: TRUE if i is boolean

Value

Nothing, calls View

Author(s)

Berry Boessenkool, [email protected], Nov 2016

See Also

sortDF, View

Examples

1
2
3
4
5
6
7
## Not run:  ## View should not be used in examples
myDF <- data.frame(A=1:30, B=cumsum(rnorm(30)))
myDF[c(5,7,23,29),1] <- NA
around(myDF, i=is.na(myDF$A))
around(myDF, i=c(11,19), n2=0)

## End(Not run)

brry/berryFunctions documentation built on Jan. 11, 2020, 11:31 a.m.