I collected some data over the summer that I am trying to analyze in a simple way. I have a few columns, but the data itself spans through 5 columns and 100+ rows.
Each row is a single participant with a participant ID. I am trying to drop their min and max measurements in their row, through all 5 columns, thus having only 3 columns left. I also need to remove any individuals who do not have all 5 measurements. Then, with those three columns, I will need to average and create a new 4th column that contains the average.
I'm getting a little overwhelmed with the different ways to do this. It needs to be able to loop through all the rows. Please let me know if you have any suggestions.
This is what the dataframe (eumR) looks like...
> eumR
town id eumr1 eumr2 eumr3 eumr4 eumr5
1 WLS SA4001 NA NA NA NA NA
2 WLS SA4002 NA NA NA NA NA
3 WLS SA4003 NA NA NA NA NA
4 WLS SA4004 NA NA NA NA NA
5 WLS SA4005 NA NA NA NA NA
....
80 BVL SA4080 12.6 15.2 13.6 14.9 14.2
81 BVL SA4081 15.2 16.5 16.5 17.3 20.5
82 BVL SA4082 15.1 14.8 14.5 14.6 16.7
83 BVL SA4083 15.6 15.8 15.8 15.5 13.2
84 BVL SA4084 15.7 15.8 17.3 17.9 20.8