head2: Gets the head (first lines) of objects/files

Description Usage Arguments Author(s) See Also Examples

Description

Gets the head (first lines) of one or several objects or a file. Depending on the argument cat, the result is either printed to the standard output (cat=TRUE) or returned as a character string. Default is to print to standard output. The number of lines printed is specified by the argument lines.

Usage

1
2
## Default S3 method:
head2(..., file, lines=10, cat=TRUE)

Arguments

...

Comma-separated list of things to be displayed.

file

File to be displayed.

lines

Number of lines printed/returned.

cat

If TRUE, the lines are printed to the standard output, otherwise they are returned as a character string.

Either ... or file must be specified.

Author(s)

Henrik Bengtsson

See Also

more(), tail2(), sink().

Examples

1
2
3
  head2(head2.default)
  head2(file=system.file("DESCRIPTION", package="base"))
  head2(list.files())

HenrikBengtsson/R.basic documentation built on May 6, 2019, 11:51 p.m.