From fdc02d17da58dd84448d397571016e3e9a59d662 Mon Sep 17 00:00:00 2001 From: robinlovelace Date: Sun, 18 Oct 2015 22:55:22 +0100 Subject: [PATCH] Update read_table_builder examples to run --- R/loadABS.R | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/R/loadABS.R b/R/loadABS.R index e1985490..4313ac0b 100644 --- a/R/loadABS.R +++ b/R/loadABS.R @@ -21,12 +21,13 @@ #' @param removeTotal A boolean value. If TRUE removes the rows and columns #' with totals (default = TRUE). #' @export -#' @examples \dontrun{ -#' read_table_builder('SA1Population.csv') -#' read_table_builder('SA1Population.xlsx',filetype='xlsx',sheet=1,removeTotal=TRUE) -#' sa1pop <- read.csv('SA1Population.csv') -#' read_table_builder(sa1pop) -#' } +#' @examples +#' data_dir <- system.file("extdata", package = "stplanr") +#' t1 <- read_table_builder(file.path(data_dir, 'SA1Population.csv')) +#' t2 <- read_table_builder(file.path(data_dir, 'SA1Population.xlsx'), +#' filetype = 'xlsx', sheet = 1, removeTotal = TRUE) +#' sa1pop <- read.csv(file.path(data_dir, 'SA1Population.csv')) +#' t3 <- read_table_builder(sa1pop) read_table_builder <- function(dataset, filetype="csv",sheet=1,removeTotal=TRUE) { if (missing(dataset)) { stop("Dataset is missing")