view: Shows a random selection of rows from a data frame or matrix.

Description Usage Arguments Value Note Author(s) Examples

View source: R/misc-utils.R

Description

Shows a random selection of rows from a data frame or matrix.

Usage

1
view(x, n = 6L, which = NULL)

Arguments

x

A data frame or matrix.

n

A single numeric that indicates the number of rows to display.

which

A numeric or string vector that contains the column numbers or names to display. Defaults to showing all columns.

Value

No value is returned but a random (but sorted) selection of rows from the data frame is displayed.

Note

If n is larger than the number of rows in x then x is displayed without randomizing the rows.

Author(s)

Derek H. Ogle, dogle@northland.edu

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(iris)
view(iris)
view(iris,10)
view(iris,which=c("Sepal.Length","Sepal.Width","Species"))
view(iris,which=grep("Sepal",names(iris)))

## Make a matrix for demonstration purposes only
miris <- as.matrix(iris[1:4,])
view(miris)
view(miris,10)
view(miris,10,which=2:4)

droglenc/NCStats documentation built on June 5, 2021, 2:06 p.m.