search for: sumto

Displaying 1 result from an estimated 1 matches for "sumto".

Did you mean: sumo
2006 Aug 30
4
Create a vector from another vector
...2,2,5,6) Because element x3[1] is larger than x[1] even though it sums to 19. Ideally, the function would take as input the original vector, x, and the number that the new vector would sum to. In this example, the vector could sum to any number 5 through 20. For example, myFun <- function(x, sumto) ... details ... Is there a preexisiting function that would already do this? I have spent too much (unsuccessful) time trying to write a function of my own but can't seem to get this to work properly. Any hints would be greatly appreciated. Harold [[alternative HTML version deleted]]