\name{daCapoApplyPrint} \alias{daCapoApplyPrint} \title{ Applies a function recursively to the parts of the daCapo object and prints the result. } \description{ Applies a function recursively to each parameter set in each model in a \code{daCapo} object. The result of each function is printed along with context information giving the name of the model and the variable currently being worked on. } \usage{ daCapoApplyPrint(daCapo.obj, FUN,..., whichStudentModels=1:length(daCapo.obj$studentModels), whichLinkModels=1:length(daCapo.obj$linkModels)) } \arguments{ \item{daCapo.obj}{A \code{daCapo} object holding data from a StatShop database.} \item{FUN}{A function which is assumed to be a graphics function, e.g., \code{plot}.} \item{\dots}{Additional arguments to the graphics function.} \item{whichStudentModels}{A vector which is used to select which student models are plotted.} \item{whichLinkModels}{A vector which is used to select which link models are plotted.} } \details{ Applies a function recursively to the parts of the daCapo object. The result of each function is printed along with context information giving the name of the model and the variable currently being worked on. Note that the main objects passed to \code{FUN} are \code{mcmc.list} objects, so generic functions should have an appropriate method for \code{mcmc.list}. The arguments \code{whichStudentModels} and \code{whichLinkModels} can be used to print out only a subset of the models. This is probably important for large plots. These are used to subset the \code{studentModels} and \code{linkModels} components of \code{daCapo.obj}, so any legal syntax for \code{"["} should work. } \note{ This function \code{dsApplyPrint} is available for doing \code{daCapo} and \code{daCapoApplyPrint} in one function call. Producing the \code{daCapo} object is more efficient if multiple diagnostics are to be run on the same object, but it can be very large in memory. } \section{Side Effects}{ Prints results to standard output (console or wherever they are currenty being set by \code{sink()}. Note: Wraps calls to \code{FUN} in try, so that errors in one model will be printed to console and the function will move on to the next model. } \seealso{ \code{\link[coda]{mcmc.list}},\code{\link{daCapo}}, \code{\link{daCapoApplyPlot}},\code{\link{grandSummary}}, \code{\link{dsApplyPrint}} } \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") dc <- daCapo(window=c(1,1000)) ## Print it all! daCapoApplyPrint(dc,grandSummary) ## Only use first two link models daCapoApplyPrint(dc,effectiveSize,whichLinkModels=1:2) ## Look at initial values (assumes burn-in is 1) daCapoApplyPrint(dc,function(param) param[1:2,]) asp.dbDisconnect() } } \keyword{database}