View source: R/ch.moralsQuantsToGrps.r
ch.moralsQuantsToGrps | R Documentation |
This function equates the probe 1 and probe 2 strings when quantity varies and bins the quantities into categories.
ch.moralsQuantsToGrps(data, probe1Col, probe2Col, quantValueCuts)
data |
morals dataframe. |
probe1Col |
a string the specifies the column name in "data" that contains the first probe item. |
probe2Col |
a string the specifies the column name in "data" that contains the second probe item. |
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 six new columns: "p1Quant" and "p1Quant" (the quantities of probe 1 and 2 respectively); "p1" and "p2" (the singular, equalized names of probe 1 and 2 respoectively); and "p1GrpSize" and "p2GrpSize" (the group categories based on quantValueCuts for probe 1 and 2 respectively).
ch.moralsQuantsToGrps (analysisReadyData.gp, "probe1", "probe2", c(1, 10, 40))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.