Learn R Programming

ggdmc (version 0.2.5.2)

cellIdx2Mat: Convert cell index list to a matrix

Description

Convert cell index list to a matrix. This is a convenient function.

Usage

cellIdx2Mat(data)

Arguments

data

a model data instance

Value

a matrix

Examples

Run this code
# NOT RUN {
m1 <- BuildModel(
    p.map     = list(a="1",v="1",z="1",d="1",sz="1",sv="1",t0="1",st0="1"),
    match.map = list(M=list(s1="r1", s2="r2")),
    factors   = list(S=c("s1", "s2")),
    constants = c(st0=0, d=0),
    responses = c("r1","r2"),
    type      = "rd")
p.prior <- BuildPrior(
    dists = rep("tnorm", 6),
    p1    = c(a=2,  v=2.5, z=.5, sz=.3, sv=1,  t0=.3),
    p2    = c(a=.5, v=.5,  z=.1, sz=.1, sv=.3, t0=.05),
    lower = c(0,-5, 0, 0, 0, 0),
    upper = c(5, 7, 2, 2, 2, 2))
dat <- simulate(m1, nsim = 4, prior = p.prior)
dmi <- BuildDMI(dat, m1)
cellIdx2Mat(dmi)
# }

Run the code above in your browser using DataLab