数据框索引
select columns from a data frame according to their position
公卫家园
dfrm[[n]]Returns one column—specifically, the nth column of dfrm.
dfrm[n]
Returns a data frame consisting solely of the nth column of dfrm.
dfrm[c(n1, n2, ..., nk)] 公卫百科
Returns a data frame built from the columns in positions n1, n2, ..., nk of dfrm.
You can use matrix-style subscripting to select one or more columns: 公卫百科
dfrm[, n]
Returns the nth column (assuming that n contains exactly one value).
dfrm[, c(n1, n2, ..., nk)]
Returns a data frame built from the columns in positions n1, n2, ..., nk.
附件列表
词条内容仅供参考,如果您需要解决具体问题
(尤其在法律、医学等领域),建议您咨询相关领域专业人士。
如果您认为本词条还有待完善,请 编辑
上一篇 创建数据框 下一篇 按数据框中的变量名选择变量