I am trying to feed a list to latex to use with SWeave, and the list comes from contents(). Since it is a list, a caption and label are generated by latex.list - these are not overridden by setting the parameters (such as caption='myCaption', label='myLabel'). I must clearly be missing something - is there no way to set a caption or label with the latex() function when the object is a list? Thanks. - Mike
Hmisc labels and captions in latex.list()
2 messages · J Michael Dean, Dieter Menne
J Michael Dean <mdean77 <at> comcast.net> writes:
I am trying to feed a list to latex to use with SWeave, and the list comes from contents(). Since it is a list, a caption and label are generated by latex.list - these are not overridden by setting the parameters (such as caption='myCaption', label='myLabel'). I must clearly be missing something - is there no way to set a caption or label with the latex() function when the object is a list?
library(Hmisc)
dfr <- data.frame(x=rnorm(20),y=sample(c('male','female'),20,TRUE))
cnt <- contents(dfr)
latex(cnt,label="tab:mytab",caption="This is a caption")
Works for me, even if I do not know what the output is good for.
Dieter