Created
February 9, 2015 04:58
-
-
Save tengpeng/28139ec2a7fcba65017a to your computer and use it in GitHub Desktop.
R: generate a repeating sequence based on vector
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rep(c(1:4), each = 10) | |
[1] 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 | |
http://stackoverflow.com/questions/3672527/r-generate-a-repeating-sequence-based-on-vector |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment