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 left at position i - 1.
1 | merge_w_left(v, i)
|
v |
A vector of response categories. |
i |
An index of the to-be-collapsed category. i must range from 2 to the maximum number of response categories. For example, for response categories 1, 2, 3, 4, and 5, "1" is not possible because there is no place to the left. Thus, i can be 2, 3, 4, or 5. |
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_right()
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_left(sparse_vector, 2)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.