Displaying 1 result from an estimated 1 matches for "q_threshold".
Did you mean:
n_threshold
2011 Jun 22
2
Linking 2 columns in 2 databases and applying a function
...2001,2001,2001,2001,2001,2002,2002,2002,2002,2002,2002),
Month=c(1,1,1,2,2,2),Q=c(5,5,5,6,6,6,3,3,3,4,4,5))
y<-data.frame(Year=c(2001,2001,2002,2002),Month=c(1,2,1,2),Threshold_Q=c(5,5,4,4))
What I'd like to do is link the Year and Month fields in both dataframes
then determine if Q exceeds Q_Threshold (by noting it with something like 1
or 0 in a new field in the dataframe x).
If I were doing this in the more-familiar-to-me Matlab, I'd just write a
pair of nested for-loops. But as we know, this won't fly in R. I've tried
reading the help pages and seeking for solutions on the net, w...