Hey guys, im trying to extract specific columns in large dataframe on R, of whch all I know is their title which is in character format. Any ideas on how I'd go about doing so?
Thanks!
Conor.
Hey guys, im trying to extract specific columns in large dataframe on R, of whch all I know is their title which is in character format. Any ideas on how I'd go about doing so?
Thanks!
Conor.
If you want to extract the columns named Value1 and Value2 from a data frame called DF, you can use basic sub setting
DFnew <- DF[, c("Value1", "Value")]
or you can use the select function from dplyr
DFnew <- select(DF, Value1, Value2)
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.