In my dataset I want to delete every row where max < 9. This is my actual code:
#my dataset my_data <- data.frame(A=c(4,1,9,1,3), B=c(3,2,8,4,2), C=c(1,2,7,2,4), D=c(4,2,9,1,1)) my_data = t(my_data) my_data <- as.data.frame(my_data) #delete every row where V3 is < 9 final <- my_data[which(1:nrow(my_data) %% my_data$V3 < 9) , ]
I already know that the maximum values are all in that column. Currently, the rows with maxima equal to 7 and 8 are not eliminated.
So, how can I delete the rows?