I have a question regarding the most efficient way to select a substring 
of a vector:

I have a vector of value v, and I want to select a subspace of this 
vector called w such that:

w=v[1:n]

where

sum(w) = x

I am interested in what you thing would be the most efficient way to do 
this - I would like to avoid slowing down my simulations as much as 
possible.

Thank you very much for any help that anyone is able to give.



Ben Hartley




-- 

        


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to