Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

view

View First/Last/Random n Elements/Rows of an Object


Description

View the first or last or random n elements or rows of an object. Components of lists will be subset using iterative calls to view.

Usage

view(obj, n=5, last=FALSE, random=FALSE, print.console=TRUE, ...)

Arguments

obj

object – an R object to view.

n

numeric – first (default)/last/random n elements/rows of obj to view.

last

logical – if TRUE, last n elements/rows of obj are displayed.

random

logical – if TRUE, n random elements/rows (without replacement) of obj are displayed.

print.console

logical – if TRUE, print the results to the console (default).
The results are also returned invisibly should the user wish to assign the output to an object.

...

dots – additional arguments (e.g., replace=TRUE if specifying random=TRUE).

Value

Invisibly returns the results of the call to view.

Note

If random=TRUE, random sampling will take place before the last operator is applied.

Author(s)

Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Institute of Ocean Sciences (IOS), Sidney BC
Last modified Rd: 2019-03-12

See Also

In package PBSmodelling:
lisp, showArgs, testCol, viewCode
In package utils:
head, tail


PBSmodelling

GUI Tools Made Easy: Interact with Models and Explore Data

v2.68.8
GPL (>= 2)
Authors
Jon T. Schnute [aut], Alex Couture-Beil [aut], Rowan Haigh [aut, cre], Nicholas Boers [ctb], Anisa Egeli [ctb], A. R. Kronlund [ctb], Steve Martell [ctb], Norm Olsen [ctb]
Initial release
2019-03-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.