data.1 <-read.csv(text = "
crop,treat,rep,x_trait,y_trait
species_A,control,1,12.2,1298.9
species_A,control,1,59.3,6845.9
species_A,control,1,227.1,13973.2
species_A,control,2,22.7,2773.8
species_A,control,2,160.3,21957.5
species_A,control,2,214.1,27503.1
species_A,stress,1,19.1,2277.9
species_A,stress,1,68.2,4582.6
species_A,stress,1,107.7,12202.9
species_A,stress,2,15.5,1801.0
species_A,stress,2,69.5,4089.6
species_A,stress,2,96.8,5490.4
species_B,control,1,6.5,1284.8
species_B,control,1,74.7,15478.6
species_B,control,1,164.0,42428.6
species_B,control,2,17.8,3431.4
species_B,control,2,19.8,2441.2
species_B,control,2,78.0,15360.5
species_B,stress,1,12.4,2180.7
species_B,stress,1,53.9,10656.2
species_B,stress,1,56.5,6414.4
species_B,stress,2,11.5,2188.6
species_B,stress,2,30.5,4511.1
species_B,stress,2,45.9,9276.5
")
I just want to filter y_trait >1000 but note that only for species_A that are under the control treatment. The following is the code that I have implemented, but unable to do so:
Any hint would be appreciated.