Описание тега subset
A subset consists of those elements selected from a larger set of elements, by their position in the larger set or other features, such as their value.
Definition:
From Wikipedia:
a set A is a subset of a set B, or equivalently B is a superset of A, if A is 'contained' inside B, that is, all elements of A are also elements of B.
Uses:
- In r,
subset
is a function that selects a subset of elements from a vector, matrix, or data frame, given some logical expression (caution:subset
drops incomplete cases; see How to subset data in R without losing NA rows?). However, for programmatic use (as opposed to interactive use) it is better to use the\[
(or[[
) operators or thefilter
function fromdplyr
.substring
is used to find subsets of character strings. - In python, a subset of an array can be obtained with
array[indices]
.