Skip to content

Commit

Permalink
Merge pull request #9 from christophsax/report-template
Browse files Browse the repository at this point in the history
Report template
  • Loading branch information
christophsax authored Mar 20, 2018
2 parents 38dbe13 + 76b187b commit 513143c
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 34 deletions.
7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
Description: Collection of tools to facitilitate the generation of interactive
Expand All @@ -18,4 +18,5 @@ Imports:
rmarkdown,
yaml
License: GPL-3
RoxygenNote: 5.0.1
RoxygenNote: 6.0.1
VignetteBuilder: knitr
5 changes: 5 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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)
1 change: 0 additions & 1 deletion R/parse_x13story.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#' Prepare an .Rmd file for use in the interactive tools
#'
#' @param file path
Expand Down
9 changes: 2 additions & 7 deletions R/x13page.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,16 @@
#' \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){

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') {
Expand Down
27 changes: 16 additions & 11 deletions inst/rmarkdown/templates/x13story/skeleton/skeleton.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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')
```




1 change: 0 additions & 1 deletion man/parse_x13story.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion man/prettify.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion man/viewer.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion man/x13page.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion man/x13story.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file removed vignettes/workflow.pdf
Binary file not shown.
12 changes: 7 additions & 5 deletions vignettes/workflow.Rmd → vignettes/x13story.Rmd
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions vignettes/x13story.sty

This file was deleted.

0 comments on commit 513143c

Please sign in to comment.