\name{variableColumns} \alias{variableColumns} \alias{variableDomain} \alias{variableType} \title{Extracts metadata about variables a StatShop database. } \usage{ variableColumns(variableData, vars) variableDomain(variableData, vars) variableType(variableData, vars) } \arguments{ \item{variableData}{Variable metadata structure, output of \code{getVariableData}} \item{vars}{Names of variables} } \value{ Returns a vector (or list for \code{variableDomain}) containing (one for each variable) of the requested metadata. } \description{ Reads information from the output of \code{getVariableMetadata} and extracts relevant bits. These functions are written in two parts to minimize database reads. The function \code{variableColumns} returns the column names associated with the variables in the database. The function \code{variableType} returns \code{"ordered"}, \code{ "factor"} or \code{"numeric"} depending on the type of the variable. Note: Due to a bug in StatShop, currently the ordered status is not properly saved, so all discrete variables are assumed to be ordered. The function returns a vector of possible states for the variable for each variable. } \seealso{ \code{\link{getVariableMetadata}}, \code{\link{getVariable}} } \examples{ ### This example will only run if you have the StatShop test databases ### installed on your machine. StatShop <- Sys.getenv("STATSHOP") if (StatShop == "") { warn("StatShop not installed, skipping test.") } else { asp.dbConnect("mcmc_statistics_test","junit") ## Get metadata for the student model variables vd <- getVariableMetadata("system") vars <- listVariables("system") ## Extract bits of metadata. variableType(vd,vars) variableDomain(vd,vars) asp.dbDisconnect() } } \keyword{database}