[R] How to fix the warning message the condition has length 1 and only the first element will be used?

2014-03-19 Thread jcrosbie
I'm trying to create a function to return the date x months in the past. With the code below I'm getting the warning message: Warning message: In if (MonthsBack = CurrentMonth) { : the condition has length 1 and only the first element will be used ## DateBack -

Re: [R] How to fix the warning message the condition has length 1 and only the first element will be used?

2014-03-19 Thread Franklin Bretschneider
Hi jcrosbie , Re: I'm trying to create a function to return the date x months in the past. With the code below I'm getting the warning message: Warning message: In if (MonthsBack = CurrentMonth) { : the condition has length 1 and only the first element will be used Use ifelse(),