| setItemText | R Documentation |
setItemText can be used to associate text (usually the item stem or a description of it) with the variables (items) in a data frame.
setItemText(x, items = NULL)
x |
a data frame |
items |
either a character vector containing the descriptions of the items (columns in the data frame) or the name of a file containing the descriptions for the items. If a file name is given, each of the descriptions must occupy one line and each item in the data frame must have a description. |
Technically, setItemText sets the item.text attribute for the variables (items) in a data frame, which corresponds to "variable labels" known form other statistical systems. This text is then displayed along with the variable name in functions such as classifyItems as a mnemonic for the content of the item.
The text can be specified either as a character vector of the same length as the number of the columns in the data frame or in a text file that contains the descriptions of the items. The file is read via read.table, with the separator set to a newline character (i.e., "\n") Consequently, each description must occupy exactly one physical line (which may, of course, span several display lines). The number of descriptions in the file and the number of items must be the same.
Notice that attributes are lost when data frames are subsetted via subset. For preserving the item.text attribute, select or filter can be used instead of subset.
A data frame with the item.text attribute set for variable.
Michael Hock michael.hock@uni-bamberg.de
getItemText for retrieving item.text attributes.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.