r extract columns from dataframe and create new data code example
Example: r - extracting specific columns from a data frame
### Solution 2
library(dplyr)
df %>%
select(A, B, E)
### Solution 2
new_df <- subset(df, select=c("A", "B", "C"))
### Solution 2
library(dplyr)
df %>%
select(A, B, E)
### Solution 2
new_df <- subset(df, select=c("A", "B", "C"))