ch.moralsQuantsToGrps: A function to equate the probe 1 and probe 2 strings when...

View source: R/ch.moralsQuantsToGrps.r

ch.moralsQuantsToGrpsR Documentation

A function to equate the probe 1 and probe 2 strings when quantity varies and bin the quantities into categories.

Description

This function equates the probe 1 and probe 2 strings when quantity varies and bins the quantities into categories.

Usage

ch.moralsQuantsToGrps(data, probe1Col, probe2Col, quantValueCuts)

Arguments

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.

Value

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).

Examples

ch.moralsQuantsToGrps (analysisReadyData.gp, "probe1", "probe2", c(1, 10, 40))

ccpluncw/ccpl_R_chMorals documentation built on Feb. 4, 2024, 3:30 p.m.