CellText.VarName Class (R)

spss.CellText.VarName(index). Used to specify that a category or cell in a pivot table is to be treated as a variable name. CellText.VarName objects honor display settings for variable names in pivot tables (names, labels, or both). The argument 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.

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,lapply(list(0,1),spss.CellText.VarName))
BasePivotTable.SetCategories(table,coldim,spss.CellText.String("Column Heading"))

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