1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
latex.psm <-
function(object, title,
file='',
append=FALSE, which=NULL, varnames,
columns=65, inline=FALSE,
before=if(inline)"" else "& &", after="",
pretrans=TRUE, caption=NULL, digits=.Options$digits, size='',
...)
{
md <- prType() %in% c('html', 'md', 'markdown')
f <- object
whichNot <- length(which)==0
w <- if(length(caption)) {
if(md) paste('<div align=center><strong>', caption,
'</strong></div>', sep='')
else
paste('\\begin{center} \\bf',caption,'\\end{center}')
}
if(whichNot & !inline)
{
dist <- f$dist
w <- c(w, paste("\\[{\\rm Prob}\\{T\\geq t\\} = ",
survreg.auxinfo[[dist]]$latex(f$scale),
"{\\rm \\ \\ where} \\\\ \\]",sep=""))
}
atr <- f$Design
if(whichNot) which <- 1:length(atr$name)
if(missing(varnames)) varnames <- atr$name[atr$assume.code!=9]
if(! md)
cat(w, sep=if(length(w)) "\n" else "", file=file, append=append)
z <- latexrms(f, file=file, append=TRUE, which=which,
varnames=varnames, columns=columns,
before=before, after=after,
prefix=if(whichNot)"X\\hat{\\beta}" else NULL,
inline=inline,pretrans=pretrans, digits=digits,
size=size)
if(md) htmltools::HTML(c(paste0(w, '\n'), as.character(z)))
else z
}
|