R package TreeBUGS. User-friendly analysis of hierarchical multinomial processing tree (MPT) models that are often used in cognitive psychology. Implements the latent-trait MPT approach (Klauer, 2010) and the beta-MPT approach (Smith & Batchelder, 2010) to model heterogeneity of participants. MPT models are conventiently specified by an .eqn-file as used by other MPT software. Data is either provided as comma-separated file (.csv) or directly in R. Models are either fitted by calling JAGS (Plummer, 2003) or by an MPT-tailored Gibbs sampler in C++ (only for nonhierarchical and beta MPT models). Provides tests of heterogeneity and MPT-tailored summaries and plotting functions.