box: Return the first N rows and columns of a data.frame or matrix

Description Usage Arguments Details Value Examples

View source: R/AllFunctions.R View source: R/data_functions.R View source: R/data_functions.R

Description

Return the first N rows and columns of a data.frame or matrix

Return the first N rows and columns of a data.frame or matrix

Usage

1
2
3
box(data, rows = 6, cols = rows)

box(data, rows = 6, cols = rows)

Arguments

data

A data.frame, matrix or data type that has both rows and columns

rows

The number of rows to be returned, similar to head(). Default value is 6.

cols

The number of columns to be returned. Defaults to the same value as rows to maintain a square format.

data

A data.frame, matrix or data type that has both rows and columns

rows

The number of rows to be returned, similar to head(). Default value is 6.

cols

The number of columns to be returned. Defaults to the same value as rows to maintain a square format.

Details

A two dimensional version of head() that is useful for working with wide datasets. Unlike head() and tail() this is not a generic function and cannot be extended to other classes.

A two dimensional version of head() that is useful for working with wide datasets. Unlike head() and tail() this is not a generic function and cannot be extended to other classes.

Value

An object (usually) like data but generally smaller.

An object (usually) like data but generally smaller.

Examples

1
2
3
4
5
6
7
8
box(iris)
box(mtcars, rows = 10, cols = 3)

box(matrix(0, nrow=3, ncol=3), 2)
box(iris)
box(mtcars, rows = 10, cols = 3)

box(matrix(0, nrow=3, ncol=3), 2)

andrewjameshaynes/helpeR documentation built on May 28, 2019, 2:44 p.m.