Learn R Programming

ptycho (version 1.1-4)

WhichCols: Identify Columns Containing Indicator Variables

Description

Determine which columns contain indic.var or indic.grp in an object returned by ptycho.

Usage

indicVarCols(obj)
indicGrpCols(obj)

Value

If the input object is a numeric vector, returns the indices of its entries that have names starting with “indic.var” or “indic.grp”, respectively.

Otherwise, it returns the indices of colnames(obj) that start with

“indic.var” or “indic.grp”, respectively.

Arguments

obj

Object output by ptycho or any numeric object

Author

Laurel Stell and Chiara Sabatti
Maintainer: Laurel Stell <lstell@stanford.edu>

See Also

ptycho; also ptychoOut and PosteriorStatistics for example below

Examples

Run this code
data(ptychoOut)
colnames(ptychoOut)[indicVarCols(ptychoOut)]
# Can also apply these functions to output of meanIndicators ...
mi <- meanIndicators(ptychoOut)
mi[indicGrpCols(mi)]
# ... instead of using meanGrpIndicators or meanVarIndicators
meanGrpIndicators(ptychoOut)

Run the code above in your browser using DataLab