学习笔记,仅供参考,有错必纠,按需更新
PS:大量参考R的帮助文档,照搬英文不翻译
subset函数
所在包:base
描述
Return subsets of vectors, matrices or data frames which meet conditions.
使用
subset(x, ...)
## Default S3 method:
subset(x, subset, ...)
## S3 method for class 'matrix'
subset(x, subset, select, drop = FALSE, ...)
## S3 method for class 'data.frame'
subset(x, subset, select, drop = FALSE, ...)
参数
参数 | 解释 |
---|---|
x | object to be subsetted |
subset | logical expression indicating elements or rows to keep: missing values are taken as false. |
select | expression, indicating columns |