powered by
Transforms a vector into an integer of IDs.
pseudo_id(x, ...)# S3 method for pseudo_id pseudo_id(x, ...)# S3 method for default pseudo_id(x, na_last = TRUE, ...)# S3 method for factor pseudo_id(x, ...)
# S3 method for pseudo_id pseudo_id(x, ...)
# S3 method for default pseudo_id(x, na_last = TRUE, ...)
# S3 method for factor pseudo_id(x, ...)
A pseudo_id object where the integer value of the vector correspond to the position of the unique values in the attribute "uniques".
pseudo_id
integer
"uniques"
A vector of values
Additional arguments passed to methods
Logical if FALSE will not place NA at the end
Logical
FALSE
NA
set.seed(42) (x <- sample(letters, 10, TRUE)) (pid <- pseudo_id(x)) attr(pid, "uniques")[pid]
Run the code above in your browser using DataLab