I want to make a data frame that only has entries below a certain defined threshold that is compared with column b, such that entry "OP2775iib SAV OP2958i_b POR" is excluded.
I tried this code:
less_than_threshold <- data.frame(which(data[data$b < threshold]))
but it returns and error that I cant quite grasp:
Error in [.data.frame
(pairwise_ind_Mdists, pairwise_ind_Mdists$Mdist < :
undefined columns selected
This is a sample of the data I'm working with:
data <- data.frame(a = c("OP2775iia MOU OP2775iib SAV","OP2775iia MOU OP2958i_a COM","OP2775iib SAV OP2958i_a COM","OP2775iia MOU OP2958i_b POR","OP2775iib SAV OP2958i_b POR"),
b = c(4.9022276,3.8867063,3.0126033,5.0261763,6.3745697))
threshold <- 6.3745697
I want a data frame that has all the entries from the original dataset except for the last entry "OP2775iib SAV OP2958i_b POR"