view {NCStats}R Documentation

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

Description

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

Usage

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

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)


[Package NCStats version 0.4.7 Index]