Description Usage Arguments Value Note See Also Examples
After sorting the response of v and putting them into a table, this function looks at the category in said table at position i and merges it with the category to the right at position i + 1.
1 | merge_w_right(v, i)
|
v |
A vector of response categories. |
i |
An index of the to-be-collapsed category. i must range from 1 to the maximum number of response categories minus 1. For example, for response categories 1, 2, 3, 4, and 5, "5" is not possible because there is no place to the right. Thus, i can be 1, 2, 3, or 4. |
A vector of collapsed response data.
This is intended as an internal function to the collapse() function. Use with care for other purposes.
collapse()
merge_w_left()
1 2 3 4 5 6 7 | ## Not run:
sparse_vector <- c(1, 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 3, 4, 4, 5, 5)
merge_w_right(sparse_vector, 2)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.