r - How to create a vector of sequences based on a vector of lengths -


I am hoping to make a vector of different length scenes (1: n). I am hoping to use the other vector to specify the length of these scenes.

For example, for my length vector:

  length < - c 10,6,4,7)  

I want to return R:

  1,2,3,4,5,6, 7,8,9,10,1,2,3,4,5,6,1,2,3,4, etc.  

I think there might be a loop in some sort of order, but I can not seem to work for it, maybe this is something like this:

 < Code> outside & lt; - For NULL (I Length (length)) {Out [i] & lt; - 1: Length [i]}  

I end up with this error:

Warning message: outside [i] & lt; - 1: Length [i]: The length of the replacement is not an honor

Any help is greatly appreciated!

  sequence (length) [1] 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 1 2 3 4 1 2 3 4 5 6 7  

Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -