0

I have dataframe like this

dataframe

I would like to subset rows based on two conditions:

  1. condition 1 is "yes"
  2. conditions 2-5 appear "yes" at least once

-> the selected rows would be A and C

Another problem is, that I would like to subset columns that meet the following criteria:

  1. condition 1 is "yes"
  2. conditions 2-5 appear only "no"

-> the selected rows would be B and D

I've tried to figure this out, but haven't found a suitable solution yet?

Mark Rotteveel
  • 90,369
  • 161
  • 124
  • 175
arto
  • 41
  • 3
  • 1
    Would you mind making your issue [reproducible](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) by providing a snippet of your data and the code you have tried. To share your data, you could type `dput(NAME_OF_DATASET)` into the console and copy & paste the output starting with `structure(....` into your post. – stefan Nov 28 '21 at 10:49

0 Answers0