middle function

Return the middle portion of data similar to head and tail

Return the middle portion of data similar to head and tail

middle(x, n = 10, evenly = TRUE, ...)

Arguments

  • x: input data that can be subset
  • n: numeric number of entries to return
  • evenly: logical indicating whether to return evenly spaced entries along the full length of x. When evenly=FALSE only the middle n entries are returned.
  • ...: additional arguments are ignored.

Returns

an object of class equivalent to x.

Details

This function is very simple, and is intended to mimic head()

and tail() to inspect data without looking at every value

Examples

x <- 1:101; middle(x); middle(x, evenly=TRUE) xdf <- data.frame(n=1:101, excel_colname=jamba::colNum2excelName(1:101)); middle(xdf) middle(xdf, evenly=TRUE)

See Also

Other jam practical functions: breakDensity(), call_fn_ellipsis(), checkLightMode(), check_pkg_installed(), colNum2excelName(), color_dither(), exp2signed(), getAxisLabel(), isFALSEV(), isTRUEV(), jargs(), kable_coloring(), lldf(), log2signed(), minorLogTicks(), newestFile(), printDebug(), reload_rmarkdown_cache(), renameColumn(), rmInfinite(), rmNA(), rmNAs(), rmNULL(), setPrompt()

  • Maintainer: James M. Ward
  • License: MIT + file LICENSE
  • Last published: 2025-03-23