Skip to content

Commit

Permalink
Merge pull request #15 from sinhrks/cln_doc
Browse files Browse the repository at this point in the history
CLN: Fix some warnings during build
  • Loading branch information
sinhrks committed Feb 4, 2015
2 parents 5ea5273 + e662a88 commit 42160ef
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 19 deletions.
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ export(infer)
export(rbind_ts)
export(unscale)
import(dplyr)
import(forecast)
import(ggplot2)
import(scales)
import(tidyr)
Expand Down
2 changes: 1 addition & 1 deletion R/base_fortify_list.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fortify.list <- function(data) {
#' Autoplot list.
#'
#' @param data \code{list} instance
#' @param ... Keywords passed to autoplot
#' @param ... Keywords passed to inferred autoplot
#' @return ggplot
#' @export
autoplot.list <- function(data, ...) {
Expand Down
6 changes: 4 additions & 2 deletions R/base_fortify_ts.R
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ fortify.irts <- fortify.ts
#' @param facets Logical value to specify use facets for multivariate time-series
#' @param nrow Number of facet/subplot rows
#' @param ncol Number of facet/subplot columns
#' @param ts.geom Geometric string for time-series plotting. 'line' or 'bar'.
#' @param ts.geom Geometric string for time-series plotting. 'line', 'bar' or 'point'.
#' @param ts.colour Line colour for time-series
#' @param ts.linetype Line type for time-series
#' @param xlab Character vector or expression for x axis label
Expand Down Expand Up @@ -181,6 +181,8 @@ autoplot.ts <- function(data, columns = NULL, group = NULL,
geomobj <- ggplot2::geom_line
} else if (ts.geom == 'bar') {
geomobj <- ggplot2::geom_bar
} else if (ts.geom == 'point') {
geomobj <- ggplot2::geom_point
} else {
stop("Invalid geom is specified. Use 'line' or 'bar'.")
}
Expand Down Expand Up @@ -457,4 +459,4 @@ autoplot.fGARCH <- autoplot.tsmodel
autoplot.dlmFiltered <- autoplot.tsmodel

#' @export
autoplot.KFS <- autoplot.tsmodel
autoplot.KFS <- autoplot.tsmodel
2 changes: 1 addition & 1 deletion R/ggfortify.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
#'
#' @name ggfortify
#' @docType package
#' @import zoo forecast scales ggplot2 dplyr tidyr
#' @import zoo scales ggplot2 dplyr tidyr
NULL
14 changes: 8 additions & 6 deletions R/plotlib.R
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ setClass('ggmultiplot',
#' Generic add operator for \code{ggmultiplot}
#'
#' @param object \code{ggmultiplot}
#' @param g
#' @param e1 first argument
#' @param e2 second argument
#' @return \code{ggmultiplot}
setMethod('+', c('ggmultiplot', 'ANY'),
function(e1, e2) {
Expand Down Expand Up @@ -141,14 +142,15 @@ print.ggmultiplot <- function(p) {
} else {
require(grid)
layout <- get.layout(nplots, p@ncol, p@nrow)
grid.newpage()
pushViewport(viewport(layout = grid.layout(nrow(layout), ncol(layout))))
grid::grid.newpage()
vp <- grid::viewport(layout = grid.layout(nrow(layout), ncol(layout)))
grid::pushViewport(vp)

for (i in 1:nplots) {
matchidx <- as.data.frame(which(layout == i, arr.ind = TRUE))

print(p@plots[[i]], vp = viewport(layout.pos.row = matchidx$row,
layout.pos.col = matchidx$col))
vp <- grid::viewport(layout.pos.row = matchidx$row,
layout.pos.col = matchidx$col)
print(p@plots[[i]], vp = vp)
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions R/tslib.R
Original file line number Diff line number Diff line change
Expand Up @@ -174,22 +174,21 @@ confint.acf <- function (x, ci = 0.95, ci.type = "white") {
#' Calcurate fitted values for \code{stats::ar}
#'
#' @param object \code{stats::ar} instance
#' @param ... other keywords
#' @return ts An time series of the one-step forecasts
#' @examples
#' fitted(ar(WWWusage))
#' @export
fitted.ar <- function(object, ...) {
library(forecast)
x <- forecast::getResponse(object)
# if (is.null(x)) {
# return(NULL)
# }
return(x - residuals(object))
}

#' Calcurate residuals for \code{stats::ar}
#'
#' @param object \code{stats::ar} instance
#' @param ... other keywords
#' @return ts Residuals extracted from the object object.
#' @examples
#' residuals(ar(WWWusage))
Expand Down Expand Up @@ -267,7 +266,8 @@ ggcpgram <- function (ts, taper = 0.1,
#' @param ad.linetype Line type for additional lines
#' @param ad.size Fill colour for additional lines
#' @param nrow Number of facet/subplot rows
#' @param ncol Number of facet/subplot columns
#' @param ncol Number of facet/subplot columns
#' @param ... other keywords
#' @return ggplot
#' @examples
#' library(ggplot2)
Expand Down
2 changes: 1 addition & 1 deletion man/autoplot.list.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
\arguments{
\item{data}{\code{list} instance}

\item{...}{Keywords passed to autoplot}
\item{...}{Keywords passed to inferred autoplot}
}
\value{
ggplot
Expand Down
2 changes: 1 addition & 1 deletion man/autoplot.ts.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ If not provided, regard the input as date when the frequency is 4 or 12.}

\item{ncol}{Number of facet/subplot columns}

\item{ts.geom}{Geometric string for time-series plotting. 'line' or 'bar'.}
\item{ts.geom}{Geometric string for time-series plotting. 'line', 'bar' or 'point'.}

\item{ts.colour}{Line colour for time-series}

Expand Down
2 changes: 2 additions & 0 deletions man/fitted.ar.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
}
\arguments{
\item{object}{\code{stats::ar} instance}

\item{...}{other keywords}
}
\value{
ts An time series of the one-step forecasts
Expand Down
2 changes: 2 additions & 0 deletions man/ggtsdiag.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ ggtsdiag(object, gof.lag = 10, conf.int = TRUE,
\item{nrow}{Number of facet/subplot rows}

\item{ncol}{Number of facet/subplot columns}

\item{...}{other keywords}
}
\value{
ggplot
Expand Down
6 changes: 4 additions & 2 deletions man/plus-ggmultiplot-ANY-method.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
\S4method{+}{ggmultiplot,ANY}(e1, e2)
}
\arguments{
\item{object}{\code{ggmultiplot}}
\item{e1}{first argument}

\item{e2}{second argument}

\item{g}{}
\item{object}{\code{ggmultiplot}}
}
\value{
\code{ggmultiplot}
Expand Down
2 changes: 2 additions & 0 deletions man/residuals.ar.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
}
\arguments{
\item{object}{\code{stats::ar} instance}

\item{...}{other keywords}
}
\value{
ts Residuals extracted from the object object.
Expand Down

0 comments on commit 42160ef

Please sign in to comment.