I have a data frame (a csv file) with dimensions 100x6 and I need only the columns c("X1", "X2", "X4") and the rows in which the value of "X1" is greater than 30. So I did:
data_frame <- read.csv ("data_frame")
data_frame [c("X1", "X2", "X4")]
The column subset problem is solved but now I need to subset rows from data_frame [c("X1", "X2", "X4")] where the values of "X1" is greater than 30. I tried:
data_frame [c("X1" > 30), c("X1", "X2", "X4")]
But it returned the same data frame as data_frame [c("X1", "X2", "X4")]. Also tried using the function subset() with the same approach but got the same results.