How to efficiently generate the following sequence of numbers in R? 4, 5, 10, 11, 16, 17, ..., 178, 179
One way is to think of it as the union of two sequences.
sort(c(seq(4,178,6), seq(5,179,6)))
 [1]   4   5  10  11  16  17  22  23  28  29  34  35  40  41  46  47  52  53  58
[20]  59  64  65  70  71  76  77  82  83  88  89  94  95 100 101 106 107 112 113
[39] 118 119 124 125 130 131 136 137 142 143 148 149 154 155 160 161 166 167 172
[58] 173 178 179
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With