]> git.donarmstrong.com Git - xtable.git/commitdiff
Added !is.null(table.placement) check.
authorroosen <roosen@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Mon, 30 Jan 2012 10:02:18 +0000 (10:02 +0000)
committerroosen <roosen@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Mon, 30 Jan 2012 10:02:18 +0000 (10:02 +0000)
git-svn-id: svn://scm.r-forge.r-project.org/svnroot/xtable@19 edb9625f-4e0d-4859-8d74-9fd3b1da38cb

pkg/R/print.xtable.R

index c51793948e526dc9e775021b0e2805b20165e355..9cc620866d2c2bb2bb70266ae53badb01ce12ddf 100644 (file)
@@ -115,7 +115,7 @@ print.xtable <- function(
   type <- tolower(type)\r
   if (!all(!is.na(match(type,c("latex","html"))))) stop("\"type\" must be in {\"latex\", \"html\"}")\r
   if (!all(!is.na(match(floating.environment,c("table","table*","sidewaystable"))))) stop("\"type\" must be in {\"table\", \"table*\", \"sidewaystable\"}")\r
-  if (!all(!is.na(match(unlist(strsplit(table.placement, split="")),c("H","h","t","b","p","!"))))) {\r
+  if (!is.null(table.placement) && !all(!is.na(match(unlist(strsplit(table.placement, split="")),c("H","h","t","b","p","!"))))) {\r
     stop("\"table.placement\" must contain only elements of {\"h\",\"t\",\"b\",\"p\",\"!\"}")\r
   }\r
   if (!all(!is.na(match(caption.placement,c("bottom","top"))))) stop("\"caption.placement\" must be either {\"bottom\",\"top\"}")\r