Description Usage Arguments Value Examples
Given a factor, this function re-assigns numerical values to each level in such a way that the resulting values are sequential. For example, if the factor has levels "red", "green", and "blue" represented by 1, 10, and 15, this function would return another factor with levels "red", "green", and "blue" with values 1, 2, and 3. This is useful in preparing categorical variables for use with JAGS or Stan.
1 | remap.contig(x)
|
x |
the variable to remap, assumed to be a factor |
a list whose elements contain
the variable x with the underlying values made contiguous
a vector with the mapping from the old to the new levels
the number of levels
the original variable that was passed in
1 2 3 4 | ## Not run:
## TODO add examples
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.