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(), that's for vectors. "If" is intended for single elements only.

Best wishes,


Franklin
-



Franklin Bretschneider
Dept of Biology
Utrecht University
brets...@xs4all.nl

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to