Generate a repeating sequence based on vector

Use each argument:

rep(c(1027, 1028, 1030, 1032, 1037), each = 6)
#  [1] 1027 1027 1027 1027 1027 1027
#  [7] 1028 1028 1028 1028 1028 1028
# [13] 1030 1030 1030 1030 1030 1030
# [19] 1032 1032 1032 1032 1032 1032
# [25] 1037 1037 1037 1037 1037 1037

times argument:

rep(c(1027, 1028, 1030, 1032, 1037), times = 6)
#  [1] 1027 1028 1030 1032 1037
#  [6] 1027 1028 1030 1032 1037
# [11] 1027 1028 1030 1032 1037
# [16] 1027 1028 1030 1032 1037
# [21] 1027 1028 1030 1032 1037
# [26] 1027 1028 1030 1032 1037

Leave a Comment