Hi, I'm printing a bunch of summary tables to a latex file using latexVerbatim from the Hmisc package. An example looks like this...> xVisit N Min. 1st Qu. Median Mean 3rd Qu. Max. NAs [1,] 1 92 25 27.28 29.05 29.47 31.75 34.8 0 And I'm using commands like this... w<-latexVerbatim(x, file="SummaryTables.tex", append=TRUE) My question is, can I lose the row label "[1,]"? I've tried using rowname=NULL as per the help page for latexVerbatim, but to no effect. Maybe there's a way to use rownamesTexCmd to delete the rownames? Many thanks, Gil [[alternative HTML version deleted]]
Have you tried setting all the rownames to be the empty string? Its a bit of a kludge, but a simple one. On Thu, Feb 13, 2014 at 3:07 PM, Gil Gamesh <gamesh.g at gmail.com> wrote:> Hi, > > I'm printing a bunch of summary tables to a latex file using latexVerbatim > from the Hmisc package. > > An example looks like this... > >> x > Visit N Min. 1st Qu. Median Mean 3rd Qu. Max. NAs > [1,] 1 92 25 27.28 29.05 29.47 31.75 34.8 0 > > > And I'm using commands like this... > > w<-latexVerbatim(x, file="SummaryTables.tex", append=TRUE) > > My question is, can I lose the row label "[1,]"? I've tried using > rowname=NULL as per the help page for latexVerbatim, but to no effect. > > Maybe there's a way to use rownamesTexCmd to delete the rownames? > > Many thanks, > > Gil > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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.-- Gregory (Greg) L. Snow Ph.D. 538280 at gmail.com
David Winsemius
2014-Feb-15 04:27 UTC
[R] Printing a matrix in latexVerbatim without rownames.
On Feb 13, 2014, at 2:07 PM, Gil Gamesh wrote:> Hi, > > I'm printing a bunch of summary tables to a latex file using latexVerbatim > from the Hmisc package. > > An example looks like this... > >> x > Visit N Min. 1st Qu. Median Mean 3rd Qu. Max. NAs > [1,] 1 92 25 27.28 29.05 29.47 31.75 34.8 0You should post dput(x)> > > And I'm using commands like this... > > w<-latexVerbatim(x, file="SummaryTables.tex", append=TRUE) > > My question is, can I lose the row label "[1,]"? I've tried using > rowname=NULL as per the help page for latexVerbatim, but to no effect.That is how R prints matrix objects. Perhaps you could convert to a dataframe and suppress rownames. But knowing whether that is effective would be facilitated by following the advice to post a reproducible example.> > Maybe there's a way to use rownamesTexCmd to delete the rownames? > > Many thanks, > > Gil > > [[alternative HTML version deleted]]Please post in plain text.> > ______________________________________________ > R-help at 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.David Winsemius Alameda, CA, USA