norpt | R Documentation |
This function removes repeated observations from a vector, filling the "gaps" with NA
values to maintain the original vector length. It's useful for preparing data for sorting where unique values are necessary, and the overall structure of the dataset (i.e., its length) should be preserved.
norpt(alist = c(1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5))
alist |
A numeric vector from which repeated values are to be removed. |
A vector excluding repeated values with trailing NA
's to fill the vector to its original length.
Stephen J. Tueller
Tueller, S. J., Van Dorn, R. A., & Bobashev, G. V. (2016). Visualization of categorical longitudinal and times series data (Report No. MR-0033-1602). Research Triangle Park, NC: RTI Press. http://www.rti.org/publication/visualization-categorical-longitudinal-and-times-series-data
makePatterns
for usage of the output from norpt
as input.
alist <- c(1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5)
norpt(alist)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.