evenInsert {BGmisc} | R Documentation |
evenInsert A function to insert m elements evenly into a length n vector.
evenInsert(m, n, verbose = FALSE)
m |
A numeric vector of length less than or equal to n. The elements to be inserted. |
n |
A numeric vector. The vector into which the elements of m will be inserted. |
verbose |
logical If TRUE, prints additional information. Default is FALSE. |
The function takes two vectors, m and n, and inserts the elements of m evenly into n. If the length of m is greater than the length of n, the vectors are swapped, and the insertion proceeds. The resulting vector is a combination of m and n, with the elements of m evenly distributed within n.
Returns a numeric vector with the elements of m evenly inserted into n.
SimPed
for the main function that uses this supporting function.