umx_tail: Show the n most extreme rows of a data.frame

umx_tailR Documentation

Show the n most extreme rows of a data.frame

Description

Sort data on the column wag and keep the n most extreme rows. what chooses which extreme:

  • high (default): the largest values, largest first.

  • low: the smallest values, smallest first.

  • both: rows from both ends. An odd n gives the extra row to the high end. The high end is printed first (largest first), then the low end (smallest first).

  • abs: the rows with the largest absolute deviation from the median of wag. wag must be numeric. Ties keep their original relative order.

Rows with NA in wag are left out of the ranking. The printed columns are face, in the order given, then wag if it is not already in face. Printing goes through umx_print(): markdown by default, or a browser table when report = "html".

Usage

umx_tail(
  data,
  wag,
  face,
  report = c("markdown", "html"),
  n = 6,
  what = c("high", "low", "both", "abs")
)

Arguments

data

A data.frame.

wag

Column name to rank on. A single string.

face

Column names to display. A character vector.

report

"markdown" (default) or "html". Passed to umx_print().

n

How many extreme rows to show. A single positive integer. Default is 6, the same as utils::tail().

what

Which extreme. One of "high", "low", "both", "abs".

Value

The selected rows and columns, invisibly. A data.frame.

See Also

umx_print()

Other Miscellaneous Utility Functions: install.OpenMx(), libs(), qm(), umx, umxLav2RAM(), umxModelNames(), umxRAM2Lav(), umxVersion(), umx_ICA_report(), umx_array_shift(), umx_data(), umx_find_object(), umx_lower.tri(), umx_msg(), umx_open_CRAN_page(), umx_pad(), umx_print(), umx_wide2long(), umx_wide4lmer()

Examples

data(mtcars)
umx_tail(mtcars, wag = "mpg", face = c("cyl", "hp"), n = 3, what = "high")
umx_tail(mtcars, wag = "mpg", face = c("cyl", "hp"), n = 4, what = "both")
## Not run: 
umx_tail(mtcars, wag = "mpg", face = c("cyl", "hp"), n = 3, report = "html")

## End(Not run)

umx documentation built on Oct. 11, 2026, 5:07 p.m.