7_head_and_tail_generalizations: Head and Tail Generalizations

Description Usage Arguments Details Value Examples

Description

Combined head and tail functions, and a grouped head function for data.frames.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
headg (...)
headt (...)

## Default S3 method:
headt(x, nh=3, nt=nh, ...)
## S3 method for class 'ObjectArray'
headt(x, nh=3, nt=nh, ...)
## S3 method for class 'MatrixLike'
headt(x, nh=3, nt=nh, ...)
## S3 method for class 'matrix'
headt(x, nh=3, nt=nh, ...)

## S3 method for class 'data.frame'
headg(x, group.by, n=3, ...)
## S3 method for class 'data.frame'
headt(x, nh=3, nt=nh, ...)

Arguments

x

An object.

group.by

A string, giving the name of the grouping variable.

n, nh, nt

Similar to head and tail.

...

Ignored.

Details

Refer to vignette for more information.

Value

These functions return formatted character matrices.

Examples

1
2
3
4
5
6
7
s = matrix (1:100, 10, 10)
x = as.PartMatrix (s, 5, c (2, 4, 6, 8) )
headt (x, c (2, 6) , 2)

headg (iris, "Species")

headt (trees)

vectools documentation built on Jan. 9, 2020, 5:09 p.m.