\name{xmlDemographicMeta} \alias{xmlDemographicMeta} \title{Constructs an XML description of a demographic variable} \description{ This constructs a \code{} description for a variable with a given \code{name} and \code{type}. } \usage{ xmlDemographicMeta(name, type, colID = name) } %- maybe also 'usage' for other objects documented here. \arguments{ \item{name}{Name of the demographic variable.} \item{type}{Type of the demographic varialbe, see details.} \item{colID}{Identifier for column in CSV file, if different than name.} } \details{ This creates a \code{} tag for use in a Pretest Description type XML file. Type is expected to be one of the values \sQuote{Integer}, \sQuote{Real}, or \sQuote{String} or else a vector of type character which gives a coding for a discrete valued variable. The column attribute is set to the value returned by \code{nextPDColumn()}. } \value{ An \code{XMLNode} object describing the demographic variable. } \references{ \url{http://research.ets.org/~ralmond/StatShop/dataFormats.html} } \author{Russell Almond} \seealso{\code{\link{xmlPretestDescription}}, \code{\link[XML]{XMLNode}}, \code{\link{nextPDColumn}} } \examples{ # Need to start column counter. resetPDColumns() demographics <- list(DOB="String", Country="String", Gender=c("M"="Male", "F"="Female", ""="NA"), Age="Integer", GPA="Real") demoNode <- xmlNode("DemographicVariables") for (dname in names(demographics)) { demoNode <- xmlAddChild(demoNode, xmlDemographicMeta(dname,demographics[[dname]])) } } \keyword{interface}% at least one, from doc/KEYWORDS