[R] Hmisc labels and captions in latex.list()

2008-12-29 Thread J Michael Dean
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 som

Re: [R] Hmisc labels and captions in latex.list()

2008-12-30 Thread Dieter Menne
J Michael Dean 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',

Re: [R] Hmisc labels and captions in latex.list()

2008-12-30 Thread J Michael Dean
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 s

Re: [R] Hmisc labels and captions in latex.list()

2008-12-30 Thread Frank E Harrell Jr
J Michael Dean wrote: 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

Re: [R] Hmisc labels and captions in latex.list()

2008-12-30 Thread J Michael Dean
Thanks, Frank. I am an old newbie, so your advice was not straightforward to me, but it nudged me to look at the structure of the contents object. I did solve the problem by passing the contents data frame in the contents object. Using the example dfr from Dieter, > g <- contents(dfr) > g