ctsem (version 3.0.4)

ctModelLatex: Generate and optionally compile latex equation of subject level ctsem model.

Description

Generate and optionally compile latex equation of subject level ctsem model.

Usage

ctModelLatex(ctmodel, matrixnames = TRUE, textsize = "normalsize",
  folder = tempdir(), filename = "ctsemTex", tex = TRUE,
  equationonly = FALSE, compile = TRUE, open = TRUE)

Arguments

ctmodel

ctsem model object

matrixnames

Logical. If TRUE, includes ctsem matrix names such as DRIFT and DIFFUSION under the matrices.

textsize

Standard latex text sizes -- tiny scriptsize footnotesize small normalsize large Large LARGE huge Huge. Useful if output overflows page.

folder

Character string specifying folder to save to, defaults to temporary directory, use "./" for working directory.

filename

filename, without suffix, to output .tex and .pdf files too.

tex

Save .tex file? Otherwise latex is simply returned within R as a string.

equationonly

Logical. If TRUE, output is only the latex relevant to the equation, not a compileable document.

compile

Compile to .pdf? (Depends on tex = TRUE)

open

Open after compiling? (Depends on compile = TRUE)

Value

character string of latex code. Side effects include saving a .tex, .pdf, and displaying the pdf.

Examples

Run this code
# NOT RUN {
ctmodel <- ctModel(type='stanct', 
n.latent=2, n.manifest=1, 
manifestNames='sunspots', 
latentNames=c('ss_level', 'ss_velocity'),
LAMBDA=matrix(c( 1, 'ma1' ), nrow=1, ncol=2),
DRIFT=matrix(c(0, 1,   'a21', 'a22'), nrow=2, ncol=2, byrow=TRUE),
MANIFESTMEANS=matrix(c('m1'), nrow=1, ncol=1),
CINT=matrix(c(0, 0), nrow=2, ncol=1),
DIFFUSION=matrix(c(
  0, 0,
  0, "diffusion"), ncol=2, nrow=2, byrow=TRUE))
  
l=ctModelLatex(ctmodel,compile=FALSE, open=FALSE)
cat(l)
# }

Run the code above in your browser using DataCamp Workspace