ch.numberVectorToGrps | R Documentation |
This function bins quantities into categories.
ch.numberVectorToGrps(data, quantCol, catNameCol, quantValueCuts)
data |
a dataframe. |
quantCol |
a string the specifies the column name in "data" that contains the variable with the quantity. This will be "p1Quant" or "p2Quant" if the items were processed with ch.moralsEquateItemStringsForNumberQuantDataset(). |
catNameCol |
a string the specifies the new column name in "data" that will be created to hold the new category names. |
quantValueCuts |
a vector of numbers that specifies the cutoff values for each quantity. The first category is <= to the first cutoff value; each successive category (c1, c2, etc) is c1 < X <= c2; the final category is greater than the last number in the vector. |
the dataframe (data) with the new category variable added.
ch.numberVectorToGrps (itemAnalDat, "p1Quant", c(1,9,40))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.