View source: R/mergecategoriescontainingranges.R
MergeRangeCategories | R Documentation |
Create new factor variables from existing factors whose labels contain numeric ranges, like 18 to 24 or $2,000 to $3,000, which are as even as possible.
MergeRangeCategories(
input.data,
num.categories = 2,
method = c("even.proportions", "even.ranges"),
grouping.mark = ",",
decimals.mark = ".",
lower.bound = "",
upper.bound = ""
)
input.data |
A |
num.categories |
An integer indicating the number of categories in the new factors, excluding any levels that do not contain range information. |
method |
A character indicating how the merging is to be performed.
The available options are |
grouping.mark |
A character indicating how thousands are grouped within the labels of the input data. Usally a comma, but sometimes a period for example in European locales. |
decimals.mark |
A character indicating how decimal values are separated in the input data. Usually a period. |
lower.bound |
A numeric value which indicates the lower bound of the numeric ranges when the number is not explicitly included in the level labels. For example, when the lowest level is "Under 18", you may wish to specify that the lowest possible value in this level is 12, 15, 0, etc. Default value of "" means that an estimate will be used based on the width of the next highest range. |
upper.bound |
As above, for the higher end of the range. |
A data frame containing the new factor variables as columns.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.