]> git.donarmstrong.com Git - xtable.git/commitdiff
Changed "print.result" to "print.results". I had specified the latter in the vignett...
authorroosen <roosen@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Mon, 30 Jan 2012 10:26:00 +0000 (10:26 +0000)
committerroosen <roosen@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Mon, 30 Jan 2012 10:26:00 +0000 (10:26 +0000)
git-svn-id: svn://scm.r-forge.r-project.org/svnroot/xtable@20 edb9625f-4e0d-4859-8d74-9fd3b1da38cb

pkg/NEWS
pkg/R/print.xtable.R
pkg/R/toLatex.R
pkg/inst/doc/xtableGallery.snw
pkg/man/print.xtable.Rd

index a2469ae2fbbe6448d29c60a209cf300b78acd854..97aa43fef74a79b1278ccaeb29dfbef3dba659ff 100644 (file)
--- a/pkg/NEWS
+++ b/pkg/NEWS
@@ -3,8 +3,11 @@
   * Added some vectorization code to improve performance.
   * Added "toLatex" method.
   * Included "print" in the exported methods in the NAMESPACE file.
-  * Added "print.result" argument to "print" that can be used to
+  * Added "print.results" argument to "print" that can be used to
     suppress the printing.
+  * Added an "is.null()" check on the "table.placement" argument.
+  * Added an example of header and footer specification with longtable
+    to the vignette.  
 
 1.6-0 (2011-10-07)
   * Allow "table*" as a value for "floating.environment" in print.xtable().
index 9cc620866d2c2bb2bb70266ae53badb01ce12ddf..2d7426787c1c6ec5e17a65010736998447fb5fc9 100644 (file)
@@ -44,7 +44,7 @@ print.xtable <- function(
   sanitize.colnames.function=sanitize.text.function,\r
   math.style.negative=FALSE,\r
   html.table.attributes="border=1",\r
-  print.result=TRUE,\r
+  print.results=TRUE,\r
   ...) {\r
   # Claudio Agostinelli <claudio@unive.it> dated 2006-07-28 hline.after\r
   # By default it print an \hline before and after the columns names independently they are printed or not and at the end of the table\r
@@ -420,7 +420,7 @@ print.xtable <- function(
     result <- result + ETABLE\r
   }   \r
   result <- sanitize.final(result)\r
-  if (print.result){\r
+  if (print.results){\r
        print(result)\r
   }\r
   \r
index 3a2ba580d38d2a1b07c33d05371c820df6216f0f..ceb8320d40e47be8f7d7ad7d729a21bbdc250365 100644 (file)
@@ -31,7 +31,7 @@ toLatex.xtable <- function(object, ...){
   dotArgs <- list(...)\r
   dotArgs$x <- object\r
   dotArgs$type <- "latex"\r
-  dotArgs$print.result <- FALSE\r
+  dotArgs$print.results <- FALSE\r
   z <- do.call("print.xtable", dotArgs)\r
 \r
   z <- strsplit(z, split="\n")[[1]]\r
index 39eb05ecbb4c41e9f1efcf682905a7bd5774bd0d..2298c93bb9756a1fad1dd74dd356405a7099014c 100644 (file)
@@ -414,6 +414,31 @@ x.big <- xtable(x,label='tabbig',
 print(x.big,tabular.environment='longtable',floating=FALSE)
 @
 
+\subsubsection{Long tables with headers on each page}
+
+The {\tt add.to.row} argument can be used to display the header 
+for a long table on each page, and to add a "continued" footer
+on all pages except the last page.
+
+<<results=tex>>=
+library(xtable)
+x<-matrix(rnorm(1000), ncol = 10)
+
+addtorow<-list()
+addtorow$pos<-list()
+addtorow$pos[[1]]<-c(0)
+addtorow$command<-c(paste(
+    "\\hline \n",
+    "  \\endhead \n",
+    "  \\hline \n",
+    "  {\\footnotesize Continued on next page} \n",
+    "  \\endfoot \n",
+    "  \\endlastfoot \n",sep=""))
+x.big <- xtable(x, label = "tabbig", 
+    caption = "Example of longtable spanning several pages")
+print(x.big, tabular.environment = "longtable", floating = FALSE,
+include.rownames=FALSE,add.to.row=addtorow,hline.after=c(-1) )
+@
 
 \subsection{Sideways tables} 
 Remember to insert \verb|\usepackage{rotating}| in your LaTeX preamble.
@@ -434,7 +459,7 @@ print(x.small,floating.environment='sidewaystable')
 \section{Suppressing Printing}
 By default the {\tt print} method will print the LaTeX or HTML to standard
 output and also return the character strings invisibly.  The printing to
-standard output can be supproessed by specifying {\tt print.result = FALSE}.
+standard output can be suppressed by specifying {\tt print.results = FALSE}.
 
 <<>>=
 # This will print the output and store it.
@@ -444,8 +469,9 @@ x.out <- print(tli.table)
 x.out2 <- print(tli.table, print.results = FALSE)
 @
 
-Formatted output can also be captured without the printing with the
-{\tt toLatex} method.
+Formatted output can also be captured without printing with the
+{\tt toLatex} method.  This function returns an object of class
+{\tt "Latex"}.
 
 <<>>=
 x.ltx <- toLatex(tli.table)
index 55ccf42d05b52f8b01c8a5dc50cff64210a0f3e4..f11aa7e525ac6172c832adb001dac77144c8e466 100644 (file)
@@ -11,7 +11,7 @@
                sanitize.text.function=NULL, sanitize.rownames.function=sanitize.text.function,
                sanitize.colnames.function=sanitize.text.function, math.style.negative=FALSE, 
                html.table.attributes="border=1", 
-               print.result=TRUE, ...)}
+               print.results=TRUE, ...)}
 \arguments{
   \item{x}{An object of class \code{"xtable"}.}
   \item{type}{Type of table to produce.  Possible values for \code{type} are \code{"latex"} or \code{"html"}.
@@ -44,7 +44,7 @@
   \item{sanitize.colnames.function}{Like the \code{sanitize.text.function}, but applicable to column names.  The default uses the \code{sanitize.text.function}.}
   \item{math.style.negative}{In a LaTeX table, if \code{TRUE}, then use $-$ for the negative sign (as was the behavior prior to version 1.5-3).  Default value is \code{FALSE}.}
   \item{html.table.attributes}{In an HTML table, attributes associated with the \code{<TABLE>} tag.  Default value is \code{border=1}.}
-  \item{print.result}{If \code{TRUE}, the generated table is printed to standard output.  Set this to \code{FALSE} if you will just be using the character vector that is returned invisibly.}
+  \item{print.results}{If \code{TRUE}, the generated table is printed to standard output.  Set this to \code{FALSE} if you will just be using the character vector that is returned invisibly.}
   \item{...}{Additional arguments.  (Currently ignored.)}
 }
 \details{