SUBSET(1G) COMMAND REFERENCE SUBSET(1G)
NAME
subset - generate a subset of a vector
SYNOPSIS
subset [ -an ] [ -bn ] [ -cn ] [ -Fvector ] [ -in ] [ -ln ]
[ -nl ] [ -np ] [ -pn ]
[ -sn ] [ -tn ] [ vector ... ]
DESCRIPTION
Output is a vector of elements selected from the input based
on a key and the values of several parameters set by
command-line options. If no vector is given, the standard
input is assumed.
If a master vector is given by the -F option, then the key
for each element of the input is the corresponding element
of master. Otherwise the key for each input element is the
input element itself.
The input element is selected if the key is:
above the value specified by the -a option, or
below the value specified by the -b option, or
equal to the value specified by the -p (pick) option,
and
not equal to the value specified by the -l (leave)
option.
If neither -a, -b, nor -p is given, then the element is
selected unless it is equal to the value specified by the -l
option.
You can also select elements according to their index
(position in the vector).
The -s (start), -t (terminate), and -i (interval) options
select every ith element from element number s to element
number t.
The -nl and -np options leave or pick elements whose index
numbers are specified by the master vector. For example, if
you use the -np option and the elements of the master are 1
3 9, the first, third, and ninth elements of the input are
selected.
If you use -s, -t, -i, -nl, or -np in conjunction with -a,
-b, -p, or -l, only those elements meeting both the position
and value qualifications are selected.
If you use either -nl or -np in conjunction with -a, -b, -p,
or -l, the key for each element is the value of the element,
not the value from the master.
Printed 4/6/89 1
SUBSET(1G) COMMAND REFERENCE SUBSET(1G)
OPTIONS
-an Select elements whose value is above n.
-bn Select elements whose value is below n.
-cn n elements per output line.
-Fvector
vector is the master.
-in Select every nth element. Default is 1 (every
element).
-ln Leave (do not select) elements whose value is equal
to n.
-nl Leave elements whose index is given in master.
-np Pick (select) elements whose index is given in
master.
-pn Select elements whose value is equal to n.
-sn Select elements starting with the nth. Default is 1.
-tn Select elements up to the nth. Default is 32767.
EXAMPLES
The following example outputs the even elements of A.
subset -i2,s2 A
The following example outputs the elements of A whose values
are greater than 8 or less
than 3.
subset -a8,b3 A
For each element in B whose value is 1, the following
example outputs the corresponding element of A.
subset -FB,p1 A
SEE ALSO
abs(1g), af(1g), bar(1g), bel(1g), bucket(1g), ceil(1g),
cor(1g), cusum(1g), cvrtopt(1g), dtoc(1g), erase(1g),
exp(1g), floor(1g), gamma(1g), gas(1g), gd(1g), ged(1g),
graphics(1g), gtop(1g), hardcopy(1g), hilo(1g), hist(1g),
hpd(1g), intro(1g), label(1g), list(1g), log(1g), lreg(1g),
mean(1g), mod(1g), pair(1g), pd(1g), pie(1g), plot(1g),
point(1g), power(1g), prime(1g), prod(1g), ptog(1g),
qsort(1g), quit(1g), rand(1g), rank(1g), remcom(1g),
Printed 4/6/89 2
SUBSET(1G) COMMAND REFERENCE SUBSET(1G)
root(1g), round(1g), siline(1g), sin(1g), td(1g),
tekset(1g), title(1g), total(1g), ttoc(1g), var(1g),
vtoc(1g), whatis(1g), yoo(1g), and gps(5g).
Printed 4/6/89 3
%%index%%
na:312,90;
sy:402,560;
de:962,2788;
op:4134,1097;
ex:5231,455;
se:5686,1111;7181,385;
%%index%%000000000119