Similar to seq_along, it creates sequences of size nrow(x) or ncol(x).

rows_along(x)

cols_along(x)

Arguments

x

Any object on which you can call nrow and ncol.

Examples

#> [1] 517 4542
str(rows_along(X))
#> int [1:517] 1 2 3 4 5 6 7 8 9 10 ...
str(cols_along(X))
#> int [1:4542] 1 2 3 4 5 6 7 8 9 10 ...