powered by
variation of recycle that recycles one vector x or y to the length of the longer one
recycle2(x, y, na.fill = FALSE)
list a list containing the recycled x vector as first and the recycled y vector as second element
vector to be recycled if shorter than y
vector to be recycled if shorter than x
Use NAs for filling up to given length (default=FALSE)
recycle2(1:10, 1:3) recycle2(1, 1:5) recycle2(1, 1:5, na.fill = TRUE) recycle2(1:5, 5:1) # vectors unchanged
Run the code above in your browser using DataLab