I need to calculate : a) the maximum and minimum (temperature) values for every row of my data set(200 such rows). b) Every column corresponds to 'Jan', 'Feb' ... 'Dec' (12 columns). Thus, I need to find the month associated with maximum and minimum temperature.
For (a) this works:
i= 1
temp.max = NULL
for(i in 1:200)
{ temp.max[i]<- max(temp.data[i,1:12])}
Can someone please help me with (b)?
eg. If the dataset looks like :
Jan Feb Mar Apr May Jun ... Dec
1 2 3 4 12 6 2
Max Value is 12. I need to output that, 'May' is the corresponding month.