diff --git a/DESCRIPTION b/DESCRIPTION index 2eb4f90..ce2dfe4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: x13story Type: Package Title: Interactive Stories on Seasonal Adjustment with X-13ARIMA-SEATS -Version: 0.0.3 -Date: 2016-12-21 +Version: 0.0.3.1 +Date: 2018-03-20 Author: James Livsey, Christoph Sax Maintainer: Christoph Sax Description: Collection of tools to facitilitate the generation of interactive @@ -18,4 +18,5 @@ Imports: rmarkdown, yaml License: GPL-3 -RoxygenNote: 5.0.1 +RoxygenNote: 6.0.1 +VignetteBuilder: knitr diff --git a/NAMESPACE b/NAMESPACE index 5ff6575..6baf920 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -5,9 +5,14 @@ export(prettify) export(viewer) export(x13page) export(x13story) +importFrom(graphics,axis) importFrom(graphics,par) importFrom(graphics,plot) +importFrom(graphics,points) +importFrom(graphics,text) importFrom(markdown,renderMarkdown) importFrom(rmarkdown,draft) +importFrom(seasonal,final) +importFrom(seasonal,outlier) importFrom(seasonal,seas) importFrom(yaml,yaml.load) diff --git a/R/parse_x13story.R b/R/parse_x13story.R index ca28229..80fc9a7 100644 --- a/R/parse_x13story.R +++ b/R/parse_x13story.R @@ -1,4 +1,3 @@ - #' Prepare an .Rmd file for use in the interactive tools #' #' @param file path diff --git a/R/x13page.R b/R/x13page.R index 0419e55..3603660 100644 --- a/R/x13page.R +++ b/R/x13page.R @@ -5,7 +5,8 @@ #' \code{?series}) #' @param pdf logical, should a plot be drawn in pdf mode #' @export -#' @importFrom graphics plot +#' @importFrom graphics axis points text plot +#' @importFrom seasonal outlier final #' @examples #' # view(story = system.file("stories", "outlier.Rmd", package="x13story")) x13page <- function(m, series = "main", pdf = TRUE){ @@ -13,13 +14,7 @@ x13page <- function(m, series = "main", pdf = TRUE){ x13page.mode = getOption("x13page.mode", "pdf") if (x13page.mode == "pdf") { # storymode "pdf" "web" - # if (pdf.summary){ - # prettysummary(m) - # } - # if (pdf.call){ - # cat("Call:\n", paste(deparse(m$call), sep = "\n", collapse = "\n")) - # } if (pdf){ if (series == 'main') { diff --git a/inst/rmarkdown/templates/x13story/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/x13story/skeleton/skeleton.Rmd index c9e44b8..c7ff328 100644 --- a/inst/rmarkdown/templates/x13story/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/x13story/skeleton/skeleton.Rmd @@ -113,25 +113,30 @@ all the time, so we can reference to them. The `data.frame` argument requires the latest dev Version of `seasonal`, which is not yet on CRAN. + + ```{r results='asis', message=FALSE, echo=FALSE} -# # xtable with reasonable options (we may do this differently at some point) -# library(xtable) -# options(xtable.include.rownames = FALSE, xtable.booktabs = TRUE) -# xtable(head(iris, 4), caption = 'Iris data') +# xtable with reasonable options (we may do this differently at some point) +library(xtable) +options(xtable.include.rownames = FALSE, xtable.booktabs = TRUE) + +m <- seas(x = AirPassengers, x11 = "") +xtable(head(as.data.frame(m), 4), caption = 'Adjusted and unadjusted data.') ``` ```{r results='asis', message=FALSE, echo=FALSE} -# m <- seas(x = AirPassengers, x11 = "") -# mstat <- formatC(1:10, width=2, flag="0") -# dta <- udg(m, paste0("f3.m", mstat), data.frame = TRUE) -# dta$key <- paste0("M", mstat) -# xtable(dta, caption = 'X-11 M Statistics') +mstat <- formatC(1:10, width=2, flag="0") +dta <- data.frame(Stat = paste0("M", mstat), Value = udg(m, paste0("f3.m", mstat))) +xtable(dta, caption = 'X-11 M Statistics') ``` ```{r results='asis', message=FALSE, echo=FALSE} -# dta <- summary(m, data.frame = TRUE) -# xtable(dta, caption = 'Coefficient Overview') +library(xtable) +options(xtable.include.rownames = FALSE, xtable.booktabs = TRUE) + +xtable(as.data.frame(summary(m)), caption = 'Coefficient Overview') ``` + diff --git a/man/parse_x13story.Rd b/man/parse_x13story.Rd index 6b07508..cbee44f 100644 --- a/man/parse_x13story.Rd +++ b/man/parse_x13story.Rd @@ -12,4 +12,3 @@ parse_x13story(file) \description{ Prepare an .Rmd file for use in the interactive tools } - diff --git a/man/prettify.Rd b/man/prettify.Rd index 83c9a29..018ef63 100644 --- a/man/prettify.Rd +++ b/man/prettify.Rd @@ -32,4 +32,3 @@ prettify(plot(density(resid(m)), main = "")) prettify(qqnorm(resid(m), main = "")) } } - diff --git a/man/viewer.Rd b/man/viewer.Rd index e7fb023..aa4568c 100644 --- a/man/viewer.Rd +++ b/man/viewer.Rd @@ -12,4 +12,3 @@ viewer(x) \description{ Deprecated Viewer Function } - diff --git a/man/x13page.Rd b/man/x13page.Rd index 624cf7f..b09a475 100644 --- a/man/x13page.Rd +++ b/man/x13page.Rd @@ -20,4 +20,3 @@ Initialize an interacitve view \examples{ # view(story = system.file("stories", "outlier.Rmd", package="x13story")) } - diff --git a/man/x13story.Rd b/man/x13story.Rd index 8eace8c..0b309cd 100644 --- a/man/x13story.Rd +++ b/man/x13story.Rd @@ -12,4 +12,3 @@ x13story(fig_width = 5) \description{ Format for creating X-13 stories } - diff --git a/vignettes/workflow.pdf b/vignettes/workflow.pdf deleted file mode 100644 index fefc5d5..0000000 Binary files a/vignettes/workflow.pdf and /dev/null differ diff --git a/vignettes/workflow.Rmd b/vignettes/x13story.Rmd similarity index 98% rename from vignettes/workflow.Rmd rename to vignettes/x13story.Rmd index c096115..bb0ad78 100644 --- a/vignettes/workflow.Rmd +++ b/vignettes/x13story.Rmd @@ -1,6 +1,7 @@ --- -title: Discussing X-13ARIMA-SEATS in R -author: James Livsey and Christoph Sax +title: "Discussing X-13ARIMA-SEATS in R" +author: "James Livsey and Christoph Sax" +output: rmarkdown::html_vignette abstract: > This vignette shows how R can be used to simplify discussions on seasonal adjustment. Thanks to the R packages *seasonal* and *x13binary*, installing @@ -9,12 +10,13 @@ abstract: > problems. Additionally, our new *x13story* package allows to document and publish discussions both as a PDF documentation or as an interactive online *story*. - -output: x13story::x13story +vignette: > + %\VignetteIndexEntry{introduction} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} --- - ## Introduction For a variety of reasons, many statistical agencies perform seasonal adjustment. diff --git a/vignettes/x13story.sty b/vignettes/x13story.sty deleted file mode 100644 index 87bac91..0000000 --- a/vignettes/x13story.sty +++ /dev/null @@ -1,2 +0,0 @@ -\usepackage{mathpazo} -