intrsectsa#
Purpose#
Returns the intersection of two string vectors, with duplicates removed.
Note
This function is deprecated, use intrsect()
instead.
Format#
- s_intr = intrsectsa(sv1, sv2)#
- Parameters:
sv1 (Nx1 or 1xN string vector) – data
sv2 (Mx1 or 1xM string vector) – data
- Returns:
s_intr (Lx1 vector) – all unique strings that are in both sv1 and sv2 sorted in ascending order.
Examples#
// Define string vector number one
vars_a = "age" $| "weight" $| "bmi";
// Define string vector number two
vars_b = "hdl" $| "ldl" $| "age" $| "bmi" $| "smoking";
shared_vars = intrsectsa(vars_a, vars_b);
print "Both studies reported the following variables:";
print shared_vars;
The code above returns:
Both studies reported the following variables:
age bmi
Remarks#
Place smaller vector first for fastest operation.
If there are a lot of duplicates it is faster to remove them with
unique()
before callingintrsectsa()
.
Source#
intrsect.src
See also
Functions intrsect()