Thanks, Dieter, for your response shown below.

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")


The problem is that I only want to display cnt[1] - I am simply making a table that shows the structure of a dataframe, and I do not want the variable levels from contents.
> class(cnt)
[1] "contents.data.frame"
> class(cnt[1])
[1] "list"

When I execute your example, it does work, but if I change it to latex(cnt[1]...) then the caption and label do not work because latex.list() is executed.

- Mike

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to