Question: I want to subset a data - frame, df , to include all columns, but keep only those rows which meet condition x - is

I want to subset a data-frame, df, to include all columns, but keep only those rows which meet condition x-is-equal-to-y (x and y are both columns within the data-frame). Which code will accomplish this for me?
Group of answer choices
df[which(df$x==y),]
df[which(df$y==x),]
Either of the above commands will work
Neither of the above commands will work

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!