Hey!

Im running several loops for my project. Im trying to make a "if" statement to do some calculations based on a sample. The dataset consists of :

ID Height Diameter Rank

(Where rank is based on diameter. Meaning rank 1 is the largest and rank 2 is the second largest etc.)

Im then taking a sample from this dataset.

What I would like to do is:

if (rows with rank 1 or 2 is found in the sample)

#Do some calculations based on that single observation

OR

if(rows with rank 1 and 2 is found in the sample)

#Do some calculations based on the two observations.

else (if neither of the "if" statements are true)

#Do some calculations

Hopefully I was able to explain to problem Im having.

Thanks for any help in advance!