Generate a sequence of integers the
length
/ncol
of an object.
id(x, prefix = FALSE, pad = TRUE, ...)
Returns a vector of sequential integers.
A dataframe, matrix, vector, or list object.
A character string to use as a prefix. FALSE
or
NULL
results in no prefix being used. TRUE
will utilize the
prefix "X."
.
logical. If TRUE
the beginning number will be padded with
zeros.
Other arguments passed to pad
.
id(list(1, 4, 6))
id(matrix(1:10, ncol=1))
id(mtcars)
id(mtcars, TRUE)
id("w")
id(mtcars, prefix="id-")
if (FALSE) {
library(qdap)
question_type(DATA.SPLIT$state, id(DATA.SPLIT, TRUE))
}
Run the code above in your browser using DataLab