且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从数据框中提取特定列

更新时间:2023-01-30 19:28:14

使用 dplyra> 包,如果您的 data.frame 被称为 df1:

Using the dplyr package, if your data.frame is called df1:

library(dplyr)

df1 %>%
  select(A, B, E)

这也可以在没有 %>% 管道的情况下编写为:

This can also be written without the %>% pipe as:

select(df1, A, B, E)