Return the middle portion of data similar to head and tail
middle(x, n = 10, evenly = TRUE, ...)
input data that can be subset
numeric
number of entries to return
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.
This function is very simple, and is intended to mimic head()
and tail()
to inspect data without looking at every value
Other jam practical functions:
breakDensity()
,
checkLightMode()
,
check_pkg_installed()
,
colNum2excelName()
,
color_dither()
,
diff_functions()
,
exp2signed()
,
fileInfo()
,
fixYellow()
,
getAxisLabel()
,
handleArgsText()
,
heads()
,
isFALSEV()
,
isTRUEV()
,
jamba
,
jargs()
,
kable_coloring()
,
lldf()
,
log2signed()
,
make_html_styles()
,
make_styles()
,
match_unique()
,
mergeAllXY()
,
minorLogTicks()
,
newestFile()
,
printDebug()
,
renameColumn()
,
rmInfinite()
,
rmNAs()
,
rmNA()
,
rmNULL()
,
sclass()
,
sdim()
,
setPrompt()
x <- 1:101;
middle(x);
#> [1] 1 12 23 34 45 57 68 79 90 101
middle(x, evenly=TRUE)
#> [1] 1 12 23 34 45 57 68 79 90 101
xdf <- data.frame(n=1:101,
excel_colname=jamba::colNum2excelName(1:101));
middle(xdf)
#> n excel_colname
#> 1 1 A
#> 12 12 L
#> 23 23 W
#> 34 34 AH
#> 45 45 AS
#> 57 57 BE
#> 68 68 BP
#> 79 79 CA
#> 90 90 CL
#> 101 101 CW
middle(xdf, evenly=TRUE)
#> n excel_colname
#> 1 1 A
#> 12 12 L
#> 23 23 W
#> 34 34 AH
#> 45 45 AS
#> 57 57 BE
#> 68 68 BP
#> 79 79 CA
#> 90 90 CL
#> 101 101 CW