search for: med_year

Displaying 1 result from an estimated 1 matches for "med_year".

2011 Jun 23
1
else problem
...67 0.1869758 [5,] 1968 0.2249865 [6,] 1969 0.1916011 I need to pick out the median year, and since there are an even number of data, I cannot use 'median' directly since it gives me a non-existent year/discharge. I found a way to get around that with the following: md <- dat2f[, list(med_year = max(year[which(abs(tot_km3y - median(tot_km3y)) == min(abs(tot_km3y - median(tot_km3y)))) ]), med_TotQ = median(tot_km3y))] (I really only need the year, not the actual discharge with that year, which is why I left med_TotQ as the true median) However, I have some data sets that have an odd numb...