Re: [R] Recyclable

2010-08-23 Thread Hadley Wickham
I should note that I realise this function is pretty trivial to write (see below), I just want to avoid reinventing the wheel. recyclable <- function(...) { lengths <- vapply(list(...), length, 1) all(max(lengths) %% lengths == 0) } Hadley On Mon, Aug 23, 2010 at 10:33 AM, Hadley Wickham w

[R] Recyclable

2010-08-23 Thread Hadley Wickham
Hi all, Is there a function to determine whether a set of vectors is cleanly recyclable? i.e. is there a common function for detecting the error/warnings that underlie the following two function calls? > 1:3 + 1:2 [1] 2 4 4 Warning message: In 1:3 + 1:2 : longer object length is not a multiple