From f57600763d929c543af2989b84b946ae39043010 Mon Sep 17 00:00:00 2001 From: roosen Date: Mon, 30 Jan 2012 10:02:18 +0000 Subject: [PATCH] Added !is.null(table.placement) check. git-svn-id: svn://scm.r-forge.r-project.org/svnroot/xtable@19 edb9625f-4e0d-4859-8d74-9fd3b1da38cb --- pkg/R/print.xtable.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/R/print.xtable.R b/pkg/R/print.xtable.R index c517939..9cc6208 100644 --- a/pkg/R/print.xtable.R +++ b/pkg/R/print.xtable.R @@ -115,7 +115,7 @@ print.xtable <- function( type <- tolower(type) if (!all(!is.na(match(type,c("latex","html"))))) stop("\"type\" must be in {\"latex\", \"html\"}") if (!all(!is.na(match(floating.environment,c("table","table*","sidewaystable"))))) stop("\"type\" must be in {\"table\", \"table*\", \"sidewaystable\"}") - if (!all(!is.na(match(unlist(strsplit(table.placement, split="")),c("H","h","t","b","p","!"))))) { + if (!is.null(table.placement) && !all(!is.na(match(unlist(strsplit(table.placement, split="")),c("H","h","t","b","p","!"))))) { stop("\"table.placement\" must contain only elements of {\"h\",\"t\",\"b\",\"p\",\"!\"}") } if (!all(!is.na(match(caption.placement,c("bottom","top"))))) stop("\"caption.placement\" must be either {\"bottom\",\"top\"}") -- 2.39.2