CellText.VarValue Class (R)

spss.CellText.VarValue(index,value). Used to specify that a category or cell in a pivot table is to be treated as a variable value. CellText.VarValue objects honor display settings for variable values in pivot tables (values, labels, or both). The argument index is the index value of the variable. Index values represent position in the active dataset, starting with 0 for the first variable in file order. The argument value is a number (for a numeric variable) or string (for a string variable) representing the value of the CellText object.

Example

table = spss.BasePivotTable("Table Title",
                            "OMS table subtype")
coldim=BasePivotTable.Append(table,Dimension.Place.column,"coldim")
rowdim=BasePivotTable.Append(table,Dimension.Place.row,"rowdim")
BasePivotTable.SetCategories(table,rowdim,list(spss.CellText.VarValue(0,1),
                                               spss.CellText.VarValue(0,2)))
BasePivotTable.SetCategories(table,coldim,spss.CellText.String("Column Heading"))

In this example, row categories are specified as the values 1 and 2 of the variable with index value 0 in the active dataset. Depending on the setting of pivot table labeling for variable values in labels, the values, value labels, or both will be displayed.