Learn R Programming

qdap (version 1.3.5)

id: ID By Row Number or Sequence Along

Description

Generate a sequence of integers the length/ncol of an object.

Usage

id(x, prefix = FALSE, pad = TRUE, ...)

Arguments

x
A dataframe, matrix, vector, or list object.
prefix
logical. If TRUE an "X." is place before each id.
pad
logical. If TRUE the beginning number will be padded with zeros.
...
Other arguments passed to link[reports]{pad}.

Value

  • Returns a vector of sequential integers.

Examples

Run this code
id(list(1, 4, 6))
id(matrix(1:10, ncol=1))
id(mtcars)
id(mtcars, TRUE)
id("w")
question_type(DATA.SPLIT$state, id(DATA.SPLIT, TRUE))

Run the code above in your browser using DataLab