Takes each element of a list and repeats each one so they
have the same length. This function is designed to be
integrated in another function and clean its arguments.
IF YOU RECEIVED A WARNING FROM THIS FUNCTION IN ANOTHER FUNCTION:
Check that the length of the arguments indicated by the warning are correct.
Usage
homogenise(i = NULL, n = NULL, l = list(), cycle = TRUE)
homogenize(i = NULL, n = NULL, l = list(), cycle = TRUE)
Value
A list identical to the one initially provided, with elements length
homogenized to i
Arguments
i
reference object of length n
n
length to reach (is overriden by i)
l
list for each element to be repeated to have a length n. These
elements have to be integers, numerics or characters.
cycle
whether to recycle the elements or to only allow elements of
length 1 or n