@take(t:tab, n:numeric) @take(t:tab, x:tab)
is a pure overloaded function. See also functions @cdr, @drop and @slice.
@take(t:tab, n:numeric)
builds a new tab with the n
first elements of t
if n > 0
and the
last -n
elements of t
if n
is negative.
@take(t:tab, x:tab)
gives the tab of elements whose indices are in tab x
.
This is equivalent to
[t[x[$i]] | $i in @size(x)]
See also Tab Related Functions @car, @cdr, @clear, @concat, @cons, @copy, @count, @dim, @domain, @drop, @empty, @explode, @find, @flatten, @gnuplot, @insert, @iota, @is_list, @is_prefix, @is_subsequence, @is_suffix, @lace, @last, @listify, @map, @max_val, @median, @member, @normalize, @occurs, @permute, @push_back, @push_front, @range, @reduce, @remove, @remove_duplicate, @replace, @resize, @reverse, @rotate, @scan, @scramble, @size, @slice, @sort, @sputter, @stutter, @tab_history, @tab_history_date, @tab_history_rdate, @take