Generate a multiple response vector
Source:R/FUNCTIONS_GENERATE_DATA.R
generate_multiple_responce_vector.RdCreates a character vector where each element contains a comma-separated string of randomly sampled categories, simulating multiple response survey data.
Arguments
- responces
Integer or character vector. The pool of unique response categories to sample from. Default is
1:4.- responded
Integer vector. Controls how many categories are selected per observation — one value is sampled from this vector at each iteration. Default is
1:4.- length
Integer. Number of observations to generate. Default is
10.