Title: | Data Visualization Tools for Statistical Analysis Results |
---|---|
Description: | Unified plotting tools for statistics commonly used, such as GLM, time series, PCA families, clustering and survival analysis. The package offers a single plotting interface for these analysis results and plots in a unified style using 'ggplot2'. |
Authors: | Masaaki Horikoshi [aut], Yuan Tang [aut, cre] , Austin Dickey [ctb], Matthias GreniƩ [ctb], Ryan Thompson [ctb], Luciano Selzer [ctb], Dario Strbenac [ctb], Kirill Voronin [ctb], Damir Pulatov [ctb] |
Maintainer: | Yuan Tang <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.4.17 |
Built: | 2024-11-21 03:20:53 UTC |
Source: | https://github.com/sinhrks/ggfortify |
ggmultiplot
Generic add operator for ggmultiplot
## S4 method for signature 'ggmultiplot,ANY' e1 + e2
## S4 method for signature 'ggmultiplot,ANY' e1 + e2
e1 |
first argument |
e2 |
second argument |
ggmultiplot
ggplot2::ggplot
Apply facets to to ggplot2::ggplot
apply_facets( p, formula, facets = TRUE, nrow = NULL, ncol = 1, scales = "free_y", ... )
apply_facets( p, formula, facets = TRUE, nrow = NULL, ncol = 1, scales = "free_y", ... )
p |
|
formula |
|
facets |
Logical value to specify use facets |
nrow |
Number of facet/subplot rows |
ncol |
Number of facet/subplot columns |
scales |
Scale value passed to |
... |
other arguments passed to methods |
ggplot
ggplot2::ggplot
Apply grid to to ggplot2::ggplot
apply_grid(p, formula, scales = "free_y", ...)
apply_grid(p, formula, scales = "free_y", ...)
p |
|
formula |
|
scales |
Scale value passed to |
... |
other arguments passed to methods |
Convert a spline basis to a tibble
## S3 method for class 'basis' as_tibble(x, ...)
## S3 method for class 'basis' as_tibble(x, ...)
x |
object of class "basis" |
... |
Ignored. |
This function is needed because the default method for converting a matrix object with an additional class attribute to a tibble causes issues because each column of the resulting tibble has the attributes, including the matrix class, copied from the source. Having matrices as columns in a tibble causes dplyr to throw errors, so a special method is needed to avoid copying the class attribute.
A tibble constructed from the underlying matrix of the basis object. Each column will possess all the attributes from the source object, except that the "class" attribute will be renamed to "basis.class" to avoid interfering with dplyr operations.
## Not run: library(splines) library(tibble) x <- seq(0, 1, by=0.001) spl <- bs(x, df=6) as_tibble(spl) ## End(Not run)
## Not run: library(splines) library(tibble) x <- seq(0, 1, by=0.001) spl <- bs(x, df=6) as_tibble(spl) ## End(Not run)
survival::aareg
Autoplot survival::aareg
## S3 method for class 'aareg' autoplot( object, maxtime = NULL, surv.connect = TRUE, facets = TRUE, ncol = NULL, xlab = "", ylab = "", ... )
## S3 method for class 'aareg' autoplot( object, maxtime = NULL, surv.connect = TRUE, facets = TRUE, ncol = NULL, xlab = "", ylab = "", ... )
object |
|
maxtime |
truncate the input to the model at time "maxtime" |
surv.connect |
logical frag indicates whether connects survival curve to the origin |
facets |
Logical value to specify use facets |
ncol |
Number of facet/subplot columns |
xlab |
character vector or expression for x axis label |
ylab |
character vector or expression for y axis label |
... |
other arguments passed to |
ggplot
## Not run: if (requireNamespace("survival", quietly = TRUE)) { autoplot(aareg(Surv(time, status) ~ age + sex + ph.ecog, data = lung, nmin = 1)) } ## End(Not run)
## Not run: if (requireNamespace("survival", quietly = TRUE)) { autoplot(aareg(Surv(time, status) ~ age + sex + ph.ecog, data = lung, nmin = 1)) } ## End(Not run)
stats::acf
. Note to pass 'plot = FALSE' to original function to suppress
standard plot outputAutoplot stats::acf
. Note to pass 'plot = FALSE' to original function to suppress
standard plot output
## S3 method for class 'acf' autoplot( object, colour = "#000000", linetype = "solid", conf.int = TRUE, conf.int.colour = "#0000FF", conf.int.linetype = "dashed", conf.int.fill = NULL, conf.int.alpha = 0.3, conf.int.value = 0.95, conf.int.type = "white", xlim = c(NA, NA), ylim = c(NA, NA), log = "", main = NULL, xlab = NULL, ylab = "ACF", asp = NULL, ... )
## S3 method for class 'acf' autoplot( object, colour = "#000000", linetype = "solid", conf.int = TRUE, conf.int.colour = "#0000FF", conf.int.linetype = "dashed", conf.int.fill = NULL, conf.int.alpha = 0.3, conf.int.value = 0.95, conf.int.type = "white", xlim = c(NA, NA), ylim = c(NA, NA), log = "", main = NULL, xlab = NULL, ylab = "ACF", asp = NULL, ... )
object |
|
colour |
Line colour |
linetype |
Line type |
conf.int |
Logical flag indicating whether to plot confidence intervals |
conf.int.colour |
line colour for confidence intervals |
conf.int.linetype |
line type for confidence intervals |
conf.int.fill |
fill colour for confidence intervals |
conf.int.alpha |
alpha for confidence intervals |
conf.int.value |
Coverage probability for confidence interval |
conf.int.type |
Type of confidence interval, 'white' for white noise or 'ma' MA(k-1) model |
xlim |
limits for x axis |
ylim |
limits for y axis |
log |
which variables to log transform ("x", "y", or "xy") |
main |
character vector or expression for plot title |
xlab |
character vector or expression for x axis label |
ylab |
character vector or expression for y axis label |
asp |
the y/x aspect ratio |
... |
other arguments passed to methods |
ggplot
## Not run: autoplot(stats::acf(AirPassengers, plot = FALSE)) autoplot(stats::pacf(AirPassengers, plot = FALSE)) autoplot(stats::ccf(AirPassengers, AirPassengers, plot = FALSE)) ## End(Not run)
## Not run: autoplot(stats::acf(AirPassengers, plot = FALSE)) autoplot(stats::pacf(AirPassengers, plot = FALSE)) autoplot(stats::ccf(AirPassengers, AirPassengers, plot = FALSE)) ## End(Not run)
Autoplot spline basis instances
## S3 method for class 'basis' autoplot(object, data, n = 256, ...)
## S3 method for class 'basis' autoplot(object, data, n = 256, ...)
object |
spline basis object |
data |
x-values at which to evaluate the splines. Optional. By default, an evenly spaced sequence of 256 values covering the range of the splines will be used. |
n |
If data is not provided, instead use an evenly-spaced sequence of x-values of this length (plus one, since both endpoints are included). If data is provided, this argument is ignored. |
... |
Ignored. |
ggplot
## Not run: library(splines) x <- seq(0, 1, by=0.001) spl <- bs(x, df=6) autoplot(spl) autoplot(spl, n=5) ## End(Not run)
## Not run: library(splines) x <- seq(0, 1, by=0.001) spl <- bs(x, df=6) autoplot(spl) autoplot(spl, n=5) ## End(Not run)
strucchange::breakpoints
Autoplot strucchange::breakpoints
## S3 method for class 'breakpoints' autoplot( object, data = NULL, cpt.colour = "#FF0000", cpt.linetype = "dashed", ... )
## S3 method for class 'breakpoints' autoplot( object, data = NULL, cpt.colour = "#FF0000", cpt.linetype = "dashed", ... )
object |
|
data |
Original time series. Mandatory for plotting |
cpt.colour |
Line colour for changepoints |
cpt.linetype |
Line type for changepoints |
... |
other arguments passed to |
ggplot
## Not run: library(strucchange) bp.nile <- breakpoints(Nile ~ 1) autoplot(bp.nile) autoplot(bp.nile, is.date = TRUE) autoplot(breakpoints(bp.nile, breaks = 2), data = Nile) ## End(Not run)
## Not run: library(strucchange) bp.nile <- breakpoints(Nile ~ 1) autoplot(bp.nile) autoplot(bp.nile, is.date = TRUE) autoplot(breakpoints(bp.nile, breaks = 2), data = Nile) ## End(Not run)
changepoint::cpt
Autoplot changepoint::cpt
## S3 method for class 'cpt' autoplot( object, is.date = NULL, cpt.colour = "#FF0000", cpt.linetype = "dashed", ... )
## S3 method for class 'cpt' autoplot( object, is.date = NULL, cpt.colour = "#FF0000", cpt.linetype = "dashed", ... )
object |
|
is.date |
Logical frag indicates whether the |
cpt.colour |
Line colour for changepoints |
cpt.linetype |
Line type for changepoints |
... |
other arguments passed |
ggplot
## Not run: library(changepoint) autoplot(cpt.mean(AirPassengers)) autoplot(cpt.meanvar(AirPassengers)) ## End(Not run)
## Not run: library(changepoint) autoplot(cpt.mean(AirPassengers)) autoplot(cpt.meanvar(AirPassengers)) ## End(Not run)
glmnet::cv.glmnet
Autoplot glmnet::cv.glmnet
## S3 method for class 'cv.glmnet' autoplot( object, sign.lambda = 1, label.n = 12, label = TRUE, label.label = "nz", label.colour = NULL, label.alpha = NULL, label.size = NULL, label.angle = NULL, label.family = NULL, label.fontface = NULL, label.lineheight = NULL, label.hjust = NULL, label.vjust = NULL, label.repel = FALSE, xlim = c(NA, NA), ylim = c(NA, NA), log = "", main = NULL, xlab = NULL, ylab = NULL, asp = NULL, ... )
## S3 method for class 'cv.glmnet' autoplot( object, sign.lambda = 1, label.n = 12, label = TRUE, label.label = "nz", label.colour = NULL, label.alpha = NULL, label.size = NULL, label.angle = NULL, label.family = NULL, label.fontface = NULL, label.lineheight = NULL, label.hjust = NULL, label.vjust = NULL, label.repel = FALSE, xlim = c(NA, NA), ylim = c(NA, NA), log = "", main = NULL, xlab = NULL, ylab = NULL, asp = NULL, ... )
object |
|
sign.lambda |
Either plot against log(lambda) (default) or its negative if |
label.n |
Number of Df labels |
label |
Logical value whether to display labels |
label.label |
Column name used for label text |
label.colour |
Colour for text labels |
label.alpha |
Alpha for text labels |
label.size |
Size for text labels |
label.angle |
Angle for text labels |
label.family |
Font family for text labels |
label.fontface |
Fontface for text labels |
label.lineheight |
Lineheight for text labels |
label.hjust |
Horizontal adjustment for text labels |
label.vjust |
Vertical adjustment for text labels |
label.repel |
Logical flag indicating whether to use |
xlim |
limits for x axis |
ylim |
limits for y axis |
log |
which variables to log transform ("x", "y", or "xy") |
main |
character vector or expression for plot title |
xlab |
character vector or expression for x axis label |
ylab |
character vector or expression for y axis label |
asp |
the y/x aspect ratio |
... |
other arguments passed to methods |
ggplot
if (requireNamespace("survival", quietly = TRUE)) { autoplot(glmnet::cv.glmnet(data.matrix(Orange[-3]), data.matrix(Orange[3]))) }
if (requireNamespace("survival", quietly = TRUE)) { autoplot(glmnet::cv.glmnet(data.matrix(Orange[-3]), data.matrix(Orange[3]))) }
stats::density
Autoplot stats::density
## S3 method for class 'density' autoplot( object, p = NULL, colour = "#000000", linetype = NULL, fill = NULL, alpha = NULL, xlim = c(NA, NA), ylim = c(NA, NA), log = "", main = NULL, xlab = NULL, ylab = NULL, asp = NULL, ... )
## S3 method for class 'density' autoplot( object, p = NULL, colour = "#000000", linetype = NULL, fill = NULL, alpha = NULL, xlim = c(NA, NA), ylim = c(NA, NA), log = "", main = NULL, xlab = NULL, ylab = NULL, asp = NULL, ... )
object |
|
p |
|
colour |
Line colour |
linetype |
Line type |
fill |
Fill colour |
alpha |
Alpha |
xlim |
limits for x axis |
ylim |
limits for y axis |
log |
which variables to log transform ("x", "y", or "xy") |
main |
character vector or expression for plot title |
xlab |
character vector or expression for x axis label |
ylab |
character vector or expression for y axis label |
asp |
the y/x aspect ratio |
... |
other arguments passed to PDC/CDF func |
ggplot
autoplot(stats::density(stats::rnorm(1:50))) autoplot(stats::density(stats::rnorm(1:50)), fill = 'blue')
autoplot(stats::density(stats::rnorm(1:50))) autoplot(stats::density(stats::rnorm(1:50)), fill = 'blue')
forecast::forecast
Autoplot forecast::forecast
## S3 method for class 'forecast' autoplot( object, is.date = NULL, ts.connect = TRUE, predict.geom = "line", predict.colour = "#0000FF", predict.size = NULL, predict.linetype = NULL, predict.alpha = NULL, predict.fill = NULL, predict.shape = NULL, conf.int = TRUE, conf.int.colour = "#0000FF", conf.int.linetype = "none", conf.int.fill = "#000000", conf.int.alpha = 0.3, ... )
## S3 method for class 'forecast' autoplot( object, is.date = NULL, ts.connect = TRUE, predict.geom = "line", predict.colour = "#0000FF", predict.size = NULL, predict.linetype = NULL, predict.alpha = NULL, predict.fill = NULL, predict.shape = NULL, conf.int = TRUE, conf.int.colour = "#0000FF", conf.int.linetype = "none", conf.int.fill = "#000000", conf.int.alpha = 0.3, ... )
object |
|
is.date |
Logical frag indicates whether the |
ts.connect |
Logical frag indicates whether connects original time-series and predicted values |
predict.geom |
geometric string for predicted time-series |
predict.colour |
line colour for predicted time-series |
predict.size |
point size for predicted time-series |
predict.linetype |
line type for predicted time-series |
predict.alpha |
alpha for predicted time-series |
predict.fill |
fill colour for predicted time-series |
predict.shape |
point shape for predicted time-series |
conf.int |
Logical flag indicating whether to plot confidence intervals |
conf.int.colour |
line colour for confidence intervals |
conf.int.linetype |
line type for confidence intervals |
conf.int.fill |
fill colour for confidence intervals |
conf.int.alpha |
alpha for confidence intervals |
... |
other arguments passed to |
ggplot
## Not run: d.arima <- forecast::auto.arima(AirPassengers) autoplot(forecast::forecast(d.arima, h = 10)) autoplot(forecast::forecast(d.arima, level = c(85), h = 10)) autoplot(forecast::forecast(d.arima, h = 5), conf.int = FALSE, is.date = FALSE) autoplot(forecast::forecast(stats::HoltWinters(UKgas), h = 10)) autoplot(forecast::forecast(forecast::ets(UKgas), h = 5)) ## End(Not run)
## Not run: d.arima <- forecast::auto.arima(AirPassengers) autoplot(forecast::forecast(d.arima, h = 10)) autoplot(forecast::forecast(d.arima, level = c(85), h = 10)) autoplot(forecast::forecast(d.arima, h = 5), conf.int = FALSE, is.date = FALSE) autoplot(forecast::forecast(stats::HoltWinters(UKgas), h = 10)) autoplot(forecast::forecast(forecast::ets(UKgas), h = 5)) ## End(Not run)
ggmultiplot
instances.
It returns the passed instance as it is.Autoplot ggmultiplot
instances.
It returns the passed instance as it is.
## S3 method for class 'ggmultiplot' autoplot(object, ...)
## S3 method for class 'ggmultiplot' autoplot(object, ...)
object |
ggmultiplot instance |
... |
Not used. |
ggmultiplot
ggplot
instances.
It returns the passed instance as it is.Autoplot ggplot
instances.
It returns the passed instance as it is.
## S3 method for class 'ggplot' autoplot(object, ...)
## S3 method for class 'ggplot' autoplot(object, ...)
object |
ggplot instance |
... |
Not used. |
ggplot
glmnet::glmnet
Autoplot glmnet::glmnet
## S3 method for class 'glmnet' autoplot( object, xvar = c("norm", "lambda", "dev"), label.n = 7, label = TRUE, label.label = "Df", label.colour = NULL, label.alpha = NULL, label.size = NULL, label.angle = NULL, label.family = NULL, label.fontface = NULL, label.lineheight = NULL, label.hjust = NULL, label.vjust = NULL, xlim = c(NA, NA), ylim = c(NA, NA), log = "", main = NULL, xlab = NULL, ylab = "Coefficients", asp = NULL, ... )
## S3 method for class 'glmnet' autoplot( object, xvar = c("norm", "lambda", "dev"), label.n = 7, label = TRUE, label.label = "Df", label.colour = NULL, label.alpha = NULL, label.size = NULL, label.angle = NULL, label.family = NULL, label.fontface = NULL, label.lineheight = NULL, label.hjust = NULL, label.vjust = NULL, xlim = c(NA, NA), ylim = c(NA, NA), log = "", main = NULL, xlab = NULL, ylab = "Coefficients", asp = NULL, ... )
object |
|
xvar |
values to be dranw on the X axis. Either "norm" (L1-norm), "lambda" (log-lambda sequence) or "dev" (percent deviance) |
label.n |
Number of Df labels |
label |
Logical value whether to display labels |
label.label |
Column name used for label text |
label.colour |
Colour for text labels |
label.alpha |
Alpha for text labels |
label.size |
Size for text labels |
label.angle |
Angle for text labels |
label.family |
Font family for text labels |
label.fontface |
Fontface for text labels |
label.lineheight |
Lineheight for text labels |
label.hjust |
Horizontal adjustment for text labels |
label.vjust |
Vertical adjustment for text labels |
xlim |
limits for x axis |
ylim |
limits for y axis |
log |
which variables to log transform ("x", "y", or "xy") |
main |
character vector or expression for plot title |
xlab |
character vector or expression for x axis label |
ylab |
character vector or expression for y axis label |
asp |
the y/x aspect ratio |
... |
other arguments passed to methods |
ggplot
## Not run: autoplot(glmnet::glmnet(data.matrix(Orange[-3]), data.matrix(Orange[3]))) ## End(Not run)
## Not run: autoplot(glmnet::glmnet(data.matrix(Orange[-3]), data.matrix(Orange[3]))) ## End(Not run)
Autoplot cluster instances
## S3 method for class 'kmeans' autoplot(object, data = NULL, colour = "cluster", ...)
## S3 method for class 'kmeans' autoplot(object, data = NULL, colour = "cluster", ...)
object |
Clustered instance |
data |
Original data used for clustering. Mandatory for |
colour |
line colour for points |
... |
other arguments passed to |
ggplot
## Not run: autoplot(stats::kmeans(iris[-5], 3), data = iris) autoplot(cluster::clara(iris[-5], 3), label = TRUE) autoplot(cluster::fanny(iris[-5], 3)) autoplot(cluster::fanny(iris[-5], 3), frame = TRUE) autoplot(cluster::pam(iris[-5], 3), data = iris, colour = 'Species') autoplot(cluster::pam(iris[-5], 3), data = iris, frame = TRUE, frame.type = 't') ## End(Not run)
## Not run: autoplot(stats::kmeans(iris[-5], 3), data = iris) autoplot(cluster::clara(iris[-5], 3), label = TRUE) autoplot(cluster::fanny(iris[-5], 3)) autoplot(cluster::fanny(iris[-5], 3), frame = TRUE) autoplot(cluster::pam(iris[-5], 3), data = iris, colour = 'Species') autoplot(cluster::pam(iris[-5], 3), data = iris, frame = TRUE, frame.type = 't') ## End(Not run)
Autoplot list
## S3 method for class 'list' autoplot(object, data = NULL, nrow = NULL, ncol = NULL, scales = "free_y", ...)
## S3 method for class 'list' autoplot(object, data = NULL, nrow = NULL, ncol = NULL, scales = "free_y", ...)
object |
|
data |
original dataset, if needed |
nrow |
Number of facet/subplot rows |
ncol |
Number of facet/subplot columns |
scales |
Scale value passed to |
... |
other arguments passed to methods |
ggplot
stats::lm
and stats::glm
Autoplot stats::lm
and stats::glm
## S3 method for class 'lm' autoplot( object, which = c(1:3, 5), data = NULL, colour = "#444444", size = NULL, linetype = NULL, alpha = NULL, fill = NULL, shape = NULL, label = TRUE, label.label = ".label", label.colour = "#000000", label.alpha = NULL, label.size = NULL, label.angle = NULL, label.family = NULL, label.fontface = NULL, label.lineheight = NULL, label.hjust = NULL, label.vjust = NULL, label.repel = FALSE, label.n = 3, smooth.colour = "#0000FF", smooth.linetype = "solid", ad.colour = "#888888", ad.linetype = "dashed", ad.size = 0.2, nrow = NULL, ncol = NULL, ... )
## S3 method for class 'lm' autoplot( object, which = c(1:3, 5), data = NULL, colour = "#444444", size = NULL, linetype = NULL, alpha = NULL, fill = NULL, shape = NULL, label = TRUE, label.label = ".label", label.colour = "#000000", label.alpha = NULL, label.size = NULL, label.angle = NULL, label.family = NULL, label.fontface = NULL, label.lineheight = NULL, label.hjust = NULL, label.vjust = NULL, label.repel = FALSE, label.n = 3, smooth.colour = "#0000FF", smooth.linetype = "solid", ad.colour = "#888888", ad.linetype = "dashed", ad.size = 0.2, nrow = NULL, ncol = NULL, ... )
object |
|
which |
If a subset of the plots is required, specify a subset of the numbers 1:6. |
data |
original dataset, if needed |
colour |
line colour |
size |
point size |
linetype |
line type |
alpha |
alpha |
fill |
fill colour |
shape |
point shape |
label |
Logical value whether to display labels |
label.label |
Column name used for label text |
label.colour |
Colour for text labels |
label.alpha |
Alpha for text labels |
label.size |
Size for text labels |
label.angle |
Angle for text labels |
label.family |
Font family for text labels |
label.fontface |
Fontface for text labels |
label.lineheight |
Lineheight for text labels |
label.hjust |
Horizontal adjustment for text labels |
label.vjust |
Vertical adjustment for text labels |
label.repel |
Logical flag indicating whether to use |
label.n |
Number of points to be laeled in each plot, starting with the most extreme |
smooth.colour |
Line colour for smoother lines |
smooth.linetype |
Line type for smoother lines |
ad.colour |
Line colour for additional lines |
ad.linetype |
Line type for additional lines |
ad.size |
Fill colour for additional lines |
nrow |
Number of facet/subplot rows |
ncol |
Number of facet/subplot columns |
... |
other arguments passed to methods |
ggplot
## Not run: autoplot(lm(Petal.Width ~ Petal.Length, data = iris)) autoplot(glm(Petal.Width ~ Petal.Length, data = iris), which = 1:6) autoplot(lm(Petal.Width~Petal.Length, data = iris), data = iris, colour = 'Species') ## End(Not run)
## Not run: autoplot(lm(Petal.Width ~ Petal.Length, data = iris)) autoplot(glm(Petal.Width ~ Petal.Length, data = iris), which = 1:6) autoplot(lm(Petal.Width~Petal.Length, data = iris), data = iris, colour = 'Species') ## End(Not run)
maps::map
Autoplot maps::map
## S3 method for class 'map' autoplot( object, p = NULL, geom = "path", group = "group", colour = "black", size = NULL, linetype = NULL, alpha = NULL, fill = NULL, shape = NULL, xlim = c(NA, NA), ylim = c(NA, NA), log = "", main = NULL, xlab = "", ylab = "", asp = NULL, ... )
## S3 method for class 'map' autoplot( object, p = NULL, geom = "path", group = "group", colour = "black", size = NULL, linetype = NULL, alpha = NULL, fill = NULL, shape = NULL, xlim = c(NA, NA), ylim = c(NA, NA), log = "", main = NULL, xlab = "", ylab = "", asp = NULL, ... )
object |
|
p |
|
geom |
geometric string for map. 'path', 'point' or 'polygon' |
group |
key for grouping geoms |
colour |
line colour |
size |
point size |
linetype |
line type |
alpha |
alpha |
fill |
fill colour |
shape |
point shape |
xlim |
limits for x axis |
ylim |
limits for y axis |
log |
which variables to log transform ("x", "y", or "xy") |
main |
character vector or expression for plot title |
xlab |
character vector or expression for x axis label |
ylab |
character vector or expression for y axis label |
asp |
the y/x aspect ratio |
... |
other arguments passed to methods |
ggplot
base::matrix
Plot base::matrix
## S3 method for class 'matrix' autoplot( object, original = NULL, geom = "tile", colour = NULL, size = NULL, alpha = NULL, fill = "#0000FF", shape = NULL, label = FALSE, label.label = "rownames", label.colour = colour, label.alpha = NULL, label.size = NULL, label.angle = NULL, label.family = NULL, label.fontface = NULL, label.lineheight = NULL, label.hjust = NULL, label.vjust = NULL, label.repel = FALSE, scale = NULL, xlim = c(NA, NA), ylim = c(NA, NA), log = "", main = NULL, xlab = NULL, ylab = NULL, asp = NULL, ... )
## S3 method for class 'matrix' autoplot( object, original = NULL, geom = "tile", colour = NULL, size = NULL, alpha = NULL, fill = "#0000FF", shape = NULL, label = FALSE, label.label = "rownames", label.colour = colour, label.alpha = NULL, label.size = NULL, label.angle = NULL, label.family = NULL, label.fontface = NULL, label.lineheight = NULL, label.hjust = NULL, label.vjust = NULL, label.repel = FALSE, scale = NULL, xlim = c(NA, NA), ylim = c(NA, NA), log = "", main = NULL, xlab = NULL, ylab = NULL, asp = NULL, ... )
object |
|
original |
Combined to data by column if provided. Intended to be used for stat functions which returns not containing original data. |
geom |
Geometric string for plotting. 'tile' or 'point'. |
colour |
colour for points ('point' only) |
size |
point size |
alpha |
alpha |
fill |
fill colour. Ignored if scale keyword is passed. ('tile' Only) |
shape |
point shape |
label |
Logical value whether to display labels |
label.label |
Column name used for label text |
label.colour |
Colour for text labels |
label.alpha |
Alpha for text labels |
label.size |
Size for text labels |
label.angle |
Angle for text labels |
label.family |
Font family for text labels |
label.fontface |
Fontface for text labels |
label.lineheight |
Lineheight for text labels |
label.hjust |
Horizontal adjustment for text labels |
label.vjust |
Vertical adjustment for text labels |
label.repel |
Logical flag indicating whether to use |
scale |
(Deprecated) |
xlim |
limits for x axis |
ylim |
limits for y axis |
log |
which variables to log transform ("x", "y", or "xy") |
main |
character vector or expression for plot title |
xlab |
character vector or expression for x axis label |
ylab |
character vector or expression for y axis label |
asp |
the y/x aspect ratio |
... |
other arguments passed to methods |
ggplot
autoplot(matrix(rnorm(20), nc = 5)) autoplot(matrix(rnorm(20), nc = 5), fill = 'red') autoplot(matrix(rnorm(20), nc = 2), geom = 'point')
autoplot(matrix(rnorm(20), nc = 5)) autoplot(matrix(rnorm(20), nc = 5), fill = 'red') autoplot(matrix(rnorm(20), nc = 2), geom = 'point')
MSwM::MSM.lm
Autoplot MSwM::MSM.lm
## S3 method for class 'MSM.lm' autoplot(object, prob.colour = "#FF0000", prob.linetype = "dashed", ...)
## S3 method for class 'MSM.lm' autoplot(object, prob.colour = "#FF0000", prob.linetype = "dashed", ...)
object |
|
prob.colour |
Line colour for probabilities |
prob.linetype |
Line type for probabilities |
... |
other arguments passed to |
ggplot
## Not run: library(MSwM) d <- data.frame(Data = c(rnorm(50, mean = -10), rnorm(50, mean = 10)), exog = cos(seq(-pi/2, pi/2, length.out = 100))) d.mswm <- MSwM::msmFit(lm(Data ~.-1, data = d), k=2, sw=rep(TRUE, 2), control = list(parallelization = FALSE)) autoplot(d.mswm) ## End(Not run)
## Not run: library(MSwM) d <- data.frame(Data = c(rnorm(50, mean = -10), rnorm(50, mean = 10)), exog = cos(seq(-pi/2, pi/2, length.out = 100))) d.mswm <- MSwM::msmFit(lm(Data ~.-1, data = d), k=2, sw=rep(TRUE, 2), control = list(parallelization = FALSE)) autoplot(d.mswm) ## End(Not run)
Autoplot PCA-likes
## S3 method for class 'pca_common' autoplot( object, data = NULL, scale = 1, x = 1, y = 2, variance_percentage = TRUE, ... )
## S3 method for class 'pca_common' autoplot( object, data = NULL, scale = 1, x = 1, y = 2, variance_percentage = TRUE, ... )
object |
PCA-like instance |
data |
Joined to fitting result if provided. |
scale |
scaling parameter, disabled by 0 |
x |
principal component number used in x axis |
y |
principal component number used in y axis |
variance_percentage |
show the variance explained by the principal component? |
... |
other arguments passed to [ggbiplot()] |
autoplot(stats::prcomp(iris[-5])) autoplot(stats::prcomp(iris[-5]), data = iris) autoplot(stats::prcomp(iris[-5]), data = iris, colour = 'Species') autoplot(stats::prcomp(iris[-5]), label = TRUE, loadings = TRUE, loadings.label = TRUE) autoplot(stats::prcomp(iris[-5]), frame = TRUE) autoplot(stats::prcomp(iris[-5]), data = iris, frame = TRUE, frame.colour = 'Species') autoplot(stats::prcomp(iris[-5]), data = iris, frame = TRUE, frame.type = 't', frame.colour = 'Species') autoplot(stats::princomp(iris[-5])) autoplot(stats::princomp(iris[-5]), data = iris) autoplot(stats::princomp(iris[-5]), data = iris, colour = 'Species') autoplot(stats::princomp(iris[-5]), label = TRUE, loadings = TRUE, loadings.label = TRUE) #Plot PC 2 and 3 autoplot(stats::princomp(iris[-5]), x = 2, y = 3) #Don't show the variance explained autoplot(stats::princomp(iris[-5]), variance_percentage = FALSE) d.factanal <- stats::factanal(state.x77, factors = 3, scores = 'regression') autoplot(d.factanal) autoplot(d.factanal, data = state.x77, colour = 'Income') autoplot(d.factanal, label = TRUE, loadings = TRUE, loadings.label = TRUE)
autoplot(stats::prcomp(iris[-5])) autoplot(stats::prcomp(iris[-5]), data = iris) autoplot(stats::prcomp(iris[-5]), data = iris, colour = 'Species') autoplot(stats::prcomp(iris[-5]), label = TRUE, loadings = TRUE, loadings.label = TRUE) autoplot(stats::prcomp(iris[-5]), frame = TRUE) autoplot(stats::prcomp(iris[-5]), data = iris, frame = TRUE, frame.colour = 'Species') autoplot(stats::prcomp(iris[-5]), data = iris, frame = TRUE, frame.type = 't', frame.colour = 'Species') autoplot(stats::princomp(iris[-5])) autoplot(stats::princomp(iris[-5]), data = iris) autoplot(stats::princomp(iris[-5]), data = iris, colour = 'Species') autoplot(stats::princomp(iris[-5]), label = TRUE, loadings = TRUE, loadings.label = TRUE) #Plot PC 2 and 3 autoplot(stats::princomp(iris[-5]), x = 2, y = 3) #Don't show the variance explained autoplot(stats::princomp(iris[-5]), variance_percentage = FALSE) d.factanal <- stats::factanal(state.x77, factors = 3, scores = 'regression') autoplot(d.factanal) autoplot(d.factanal, data = state.x77, colour = 'Income') autoplot(d.factanal, label = TRUE, loadings = TRUE, loadings.label = TRUE)
ROCR::performance
Autoplot ROCR::performance
## S3 method for class 'performance' autoplot(object, p = NULL, bins = 5, ...)
## S3 method for class 'performance' autoplot(object, p = NULL, bins = 5, ...)
object |
|
p |
|
bins |
If |
... |
other arguments passed to methods |
ggplot
raster::raster
Only plot the first layer of the given raster
## S3 method for class 'RasterCommon' autoplot( object, raster.layer = NULL, p = NULL, alpha = NULL, xlim = c(NA, NA), ylim = c(NA, NA), log = "", main = NULL, xlab = "", ylab = "", asp = NULL, ... )
## S3 method for class 'RasterCommon' autoplot( object, raster.layer = NULL, p = NULL, alpha = NULL, xlim = c(NA, NA), ylim = c(NA, NA), log = "", main = NULL, xlab = "", ylab = "", asp = NULL, ... )
object |
|
raster.layer |
name of the layer to plot |
p |
|
alpha |
alpha |
xlim |
limits for x axis |
ylim |
limits for y axis |
log |
which variables to log transform ("x", "y", or "xy") |
main |
character vector or expression for plot title |
xlab |
character vector or expression for x axis label |
ylab |
character vector or expression for y axis label |
asp |
the y/x aspect ratio |
... |
other arguments passed to methods |
ggplot
Autoplot silhouette instances
## S3 method for class 'silhouette' autoplot( object, colour = "red", linetype = "dashed", size = 0.5, bar.width = 1, ... )
## S3 method for class 'silhouette' autoplot( object, colour = "red", linetype = "dashed", size = 0.5, bar.width = 1, ... )
object |
Silhouette instance |
colour |
reference line color |
linetype |
reference line type |
size |
reference line size |
bar.width |
bar width |
... |
other arguments passed to methods |
ggplot
## Not run: model = cluster::pam(iris[-5], 3L) sil = cluster::silhouette(model) autoplot(sil) autoplot(cluster::silhouette(cluster::clara(iris[-5], 3))) autoplot(cluster::silhouette(cluster::fanny(iris[-5], 3))) model = stats::kmeans(iris[-5], 3) sil = cluster::silhouette(model$cluster, stats::dist(iris[-5])) autoplot(sil) ## End(Not run)
## Not run: model = cluster::pam(iris[-5], 3L) sil = cluster::silhouette(model) autoplot(sil) autoplot(cluster::silhouette(cluster::clara(iris[-5], 3))) autoplot(cluster::silhouette(cluster::fanny(iris[-5], 3))) model = stats::kmeans(iris[-5], 3) sil = cluster::silhouette(model$cluster, stats::dist(iris[-5])) autoplot(sil) ## End(Not run)
maps::map
Autoplot maps::map
## S3 method for class 'SpatialCommon' autoplot( object, p = NULL, group = NULL, colour = "black", size = NULL, linetype = NULL, alpha = NULL, fill = NULL, shape = NULL, xlim = c(NA, NA), ylim = c(NA, NA), log = "", main = NULL, xlab = "", ylab = "", asp = NULL, ... )
## S3 method for class 'SpatialCommon' autoplot( object, p = NULL, group = NULL, colour = "black", size = NULL, linetype = NULL, alpha = NULL, fill = NULL, shape = NULL, xlim = c(NA, NA), ylim = c(NA, NA), log = "", main = NULL, xlab = "", ylab = "", asp = NULL, ... )
object |
|
p |
|
group |
key for grouping geoms |
colour |
line colour |
size |
point size |
linetype |
line type |
alpha |
alpha |
fill |
fill colour |
shape |
point shape |
xlim |
limits for x axis |
ylim |
limits for y axis |
log |
which variables to log transform ("x", "y", or "xy") |
main |
character vector or expression for plot title |
xlab |
character vector or expression for x axis label |
ylab |
character vector or expression for y axis label |
asp |
the y/x aspect ratio |
... |
other arguments passed to methods |
ggplot
stats::spec
Autoplot stats::spec
## S3 method for class 'spec' autoplot( object, xlim = c(NA, NA), ylim = c(NA, NA), log = "y", main = NULL, xlab = NULL, ylab = NULL, asp = NULL, ... )
## S3 method for class 'spec' autoplot( object, xlim = c(NA, NA), ylim = c(NA, NA), log = "y", main = NULL, xlab = NULL, ylab = NULL, asp = NULL, ... )
object |
|
xlim |
limits for x axis |
ylim |
limits for y axis |
log |
which variables to log transform ("x", "y", or "xy") |
main |
character vector or expression for plot title |
xlab |
character vector or expression for x axis label |
ylab |
character vector or expression for y axis label |
asp |
the y/x aspect ratio |
... |
other arguments passed to methods |
ggplot
## Not run: autoplot(stats::spec.ar(AirPassengers)) autoplot(stats::spec.pgram(AirPassengers)) ## End(Not run)
## Not run: autoplot(stats::spec.ar(AirPassengers)) autoplot(stats::spec.pgram(AirPassengers)) ## End(Not run)
stats::stepfun
Plot stats::stepfun
## S3 method for class 'stepfun' autoplot( object, colour = NULL, size = NULL, linetype = NULL, alpha = NULL, shape = 1, xlim = c(NA, NA), ylim = c(NA, NA), log = "", main = NULL, xlab = NULL, ylab = NULL, asp = NULL, ... )
## S3 method for class 'stepfun' autoplot( object, colour = NULL, size = NULL, linetype = NULL, alpha = NULL, shape = 1, xlim = c(NA, NA), ylim = c(NA, NA), log = "", main = NULL, xlab = NULL, ylab = NULL, asp = NULL, ... )
object |
|
colour |
colour |
size |
point size |
linetype |
line type |
alpha |
alpha |
shape |
point shape |
xlim |
limits for x axis |
ylim |
limits for y axis |
log |
which variables to log transform ("x", "y", or "xy") |
main |
character vector or expression for plot title |
xlab |
character vector or expression for x axis label |
ylab |
character vector or expression for y axis label |
asp |
the y/x aspect ratio |
... |
other arguments passed to methods |
ggplot
autoplot(stepfun(c(1, 2, 3), c(4, 5, 6, 7))) autoplot(stepfun(c(1), c(4, 5)), shape = NULL) autoplot(stepfun(c(1, 3, 4, 8), c(4, 5, 2, 3, 5)), linetype = 'dashed') autoplot(stepfun(c(1, 2, 3, 4, 5, 6, 7, 8, 10), c(4, 5, 6, 7, 8, 9, 10, 11, 12, 9)), colour = 'red')
autoplot(stepfun(c(1, 2, 3), c(4, 5, 6, 7))) autoplot(stepfun(c(1), c(4, 5)), shape = NULL) autoplot(stepfun(c(1, 3, 4, 8), c(4, 5, 2, 3, 5)), linetype = 'dashed') autoplot(stepfun(c(1, 2, 3, 4, 5, 6, 7, 8, 10), c(4, 5, 6, 7, 8, 9, 10, 11, 12, 9)), colour = 'red')
survival::survfit
Autoplot survival::survfit
## S3 method for class 'survfit' autoplot( object, fun = NULL, surv.geom = "step", surv.colour = NULL, surv.size = NULL, surv.linetype = NULL, surv.alpha = NULL, surv.fill = NULL, surv.shape = NULL, surv.connect = TRUE, conf.int = TRUE, conf.int.colour = "#0000FF", conf.int.linetype = "none", conf.int.fill = "#000000", conf.int.alpha = 0.3, censor = TRUE, censor.colour = NULL, censor.size = 3, censor.alpha = NULL, censor.shape = "+", facets = FALSE, nrow = NULL, ncol = 1, grid = FALSE, strip_swap = FALSE, scales = "free_y", xlim = c(NA, NA), ylim = c(NA, NA), log = "", main = NULL, xlab = NULL, ylab = NULL, asp = NULL, ... )
## S3 method for class 'survfit' autoplot( object, fun = NULL, surv.geom = "step", surv.colour = NULL, surv.size = NULL, surv.linetype = NULL, surv.alpha = NULL, surv.fill = NULL, surv.shape = NULL, surv.connect = TRUE, conf.int = TRUE, conf.int.colour = "#0000FF", conf.int.linetype = "none", conf.int.fill = "#000000", conf.int.alpha = 0.3, censor = TRUE, censor.colour = NULL, censor.size = 3, censor.alpha = NULL, censor.shape = "+", facets = FALSE, nrow = NULL, ncol = 1, grid = FALSE, strip_swap = FALSE, scales = "free_y", xlim = c(NA, NA), ylim = c(NA, NA), log = "", main = NULL, xlab = NULL, ylab = NULL, asp = NULL, ... )
object |
|
fun |
an arbitrary function defining a transformation of the survival curve |
surv.geom |
geometric string for survival curve. 'step', 'line' or 'point' |
surv.colour |
line colour for survival curve |
surv.size |
point size for survival curve |
surv.linetype |
line type for survival curve |
surv.alpha |
alpha for survival curve |
surv.fill |
fill colour survival curve |
surv.shape |
point shape survival curve |
surv.connect |
logical frag indicates whether connects survival curve to the origin |
conf.int |
Logical flag indicating whether to plot confidence intervals |
conf.int.colour |
line colour for confidence intervals |
conf.int.linetype |
line type for confidence intervals |
conf.int.fill |
fill colour for confidence intervals |
conf.int.alpha |
alpha for confidence intervals |
censor |
Logical flag indicating whether to plot censors |
censor.colour |
colour for censors |
censor.size |
size for censors |
censor.alpha |
alpha for censors |
censor.shape |
shape for censors |
facets |
Logical value to specify use facets |
nrow |
Number of facet/subplot rows |
ncol |
Number of facet/subplot columns |
grid |
Logical flag indicating whether to draw grid |
strip_swap |
swap facet or grid strips |
scales |
Scale value passed to |
xlim |
limits for x axis |
ylim |
limits for y axis |
log |
which variables to log transform ("x", "y", or "xy") |
main |
character vector or expression for plot title |
xlab |
character vector or expression for x axis label |
ylab |
character vector or expression for y axis label |
asp |
the y/x aspect ratio |
... |
other arguments passed to methods |
ggplot
## Not run: if (requireNamespace("survival", quietly = TRUE)) { autoplot(survfit(Surv(time, status) ~ sex, data = lung)) autoplot(survfit(Surv(time, status) ~ sex, data = lung), facets = TRUE) autoplot(survfit(Surv(time, status) ~ 1, data = lung)) autoplot(survfit(Surv(time, status) ~ sex, data=lung), conf.int = FALSE, censor = FALSE) autoplot(survfit(coxph(Surv(time, status) ~ sex, data = lung))) } ## End(Not run)
## Not run: if (requireNamespace("survival", quietly = TRUE)) { autoplot(survfit(Surv(time, status) ~ sex, data = lung)) autoplot(survfit(Surv(time, status) ~ sex, data = lung), facets = TRUE) autoplot(survfit(Surv(time, status) ~ 1, data = lung)) autoplot(survfit(Surv(time, status) ~ sex, data=lung), conf.int = FALSE, censor = FALSE) autoplot(survfit(coxph(Surv(time, status) ~ sex, data = lung))) } ## End(Not run)
Autoplot time-series-like
## S3 method for class 'ts' autoplot( object, columns = NULL, group = NULL, is.date = NULL, index.name = "Index", p = NULL, ts.scale = FALSE, stacked = FALSE, facets = TRUE, nrow = NULL, ncol = 1, scales = "free_y", ts.geom = "line", ts.colour = NULL, ts.size = NULL, ts.linetype = NULL, ts.alpha = NULL, ts.fill = NULL, ts.shape = NULL, geom = ts.geom, colour = ts.colour, size = ts.size, linetype = ts.linetype, alpha = ts.alpha, fill = ts.fill, shape = ts.shape, xlim = c(NA, NA), ylim = c(NA, NA), log = "", main = NULL, xlab = "", ylab = "", asp = NULL, ... )
## S3 method for class 'ts' autoplot( object, columns = NULL, group = NULL, is.date = NULL, index.name = "Index", p = NULL, ts.scale = FALSE, stacked = FALSE, facets = TRUE, nrow = NULL, ncol = 1, scales = "free_y", ts.geom = "line", ts.colour = NULL, ts.size = NULL, ts.linetype = NULL, ts.alpha = NULL, ts.fill = NULL, ts.shape = NULL, geom = ts.geom, colour = ts.colour, size = ts.size, linetype = ts.linetype, alpha = ts.alpha, fill = ts.fill, shape = ts.shape, xlim = c(NA, NA), ylim = c(NA, NA), log = "", main = NULL, xlab = "", ylab = "", asp = NULL, ... )
object |
time-series-like instance |
columns |
Character vector specifies target column name(s) |
group |
Character vector specifies grouping |
is.date |
Logical frag indicates whether the |
index.name |
Specify column name for time series index when passing |
p |
|
ts.scale |
Logical flag indicating whether to perform scaling each timeseries |
stacked |
Logical flag indicating whether to stack multivariate timeseries |
facets |
Logical value to specify use facets |
nrow |
Number of facet/subplot rows |
ncol |
Number of facet/subplot columns |
scales |
Scale value passed to |
ts.geom |
geometric string for time-series. 'line', 'bar', 'ribbon', or 'point' |
ts.colour |
line colour for time-series |
ts.size |
point size for time-series |
ts.linetype |
line type for time-series |
ts.alpha |
alpha for time-series |
ts.fill |
fill colour for time-series |
ts.shape |
point shape for time-series |
geom |
same as ts.geom |
colour |
same as ts.colour |
size |
same as ts.size |
linetype |
same as ts.linetype |
alpha |
same as ts.alpha |
fill |
same as ts.fill |
shape |
same as ts.shape |
xlim |
limits for x axis |
ylim |
limits for y axis |
log |
which variables to log transform ("x", "y", or "xy") |
main |
character vector or expression for plot title |
xlab |
character vector or expression for x axis label |
ylab |
character vector or expression for y axis label |
asp |
the y/x aspect ratio |
... |
other arguments passed to methods |
ggplot
## Not run: data(Canada, package = 'vars') autoplot(AirPassengers) autoplot(UKgas, ts.geom = 'bar') autoplot(Canada) autoplot(Canada, facets = FALSE) library(zoo) autoplot(xts::as.xts(AirPassengers)) autoplot(timeSeries::as.timeSeries(AirPassengers)) its <- tseries::irts(cumsum(rexp(10, rate = 0.1)), matrix(rnorm(20), ncol=2)) autoplot(its) autoplot(stats::stl(UKgas, s.window = 'periodic')) autoplot(stats::decompose(UKgas)) ## End(Not run)
## Not run: data(Canada, package = 'vars') autoplot(AirPassengers) autoplot(UKgas, ts.geom = 'bar') autoplot(Canada) autoplot(Canada, facets = FALSE) library(zoo) autoplot(xts::as.xts(AirPassengers)) autoplot(timeSeries::as.timeSeries(AirPassengers)) its <- tseries::irts(cumsum(rexp(10, rate = 0.1)), matrix(rnorm(20), ncol=2)) autoplot(its) autoplot(stats::stl(UKgas, s.window = 'periodic')) autoplot(stats::decompose(UKgas)) ## End(Not run)
Autoplot time series models (like AR, ARIMA)
## S3 method for class 'tsmodel' autoplot( object, data = NULL, predict = NULL, is.date = NULL, ts.connect = TRUE, fitted.geom = "line", fitted.colour = "#FF0000", fitted.size = NULL, fitted.linetype = NULL, fitted.alpha = NULL, fitted.fill = NULL, fitted.shape = NULL, predict.geom = "line", predict.colour = "#0000FF", predict.size = NULL, predict.linetype = NULL, predict.alpha = NULL, predict.fill = NULL, predict.shape = NULL, conf.int = TRUE, conf.int.colour = "#0000FF", conf.int.linetype = "none", conf.int.fill = "#000000", conf.int.alpha = 0.3, ... )
## S3 method for class 'tsmodel' autoplot( object, data = NULL, predict = NULL, is.date = NULL, ts.connect = TRUE, fitted.geom = "line", fitted.colour = "#FF0000", fitted.size = NULL, fitted.linetype = NULL, fitted.alpha = NULL, fitted.fill = NULL, fitted.shape = NULL, predict.geom = "line", predict.colour = "#0000FF", predict.size = NULL, predict.linetype = NULL, predict.alpha = NULL, predict.fill = NULL, predict.shape = NULL, conf.int = TRUE, conf.int.colour = "#0000FF", conf.int.linetype = "none", conf.int.fill = "#000000", conf.int.alpha = 0.3, ... )
object |
Time series model instance |
data |
original dataset, needed for |
predict |
Predicted |
is.date |
Logical frag indicates whether the |
ts.connect |
Logical frag indicates whether connects original time-series and predicted values |
fitted.geom |
geometric string for fitted time-series |
fitted.colour |
line colour for fitted time-series |
fitted.size |
point size for fitted time-series |
fitted.linetype |
line type for fitted time-series |
fitted.alpha |
alpha for fitted time-series |
fitted.fill |
fill colour for fitted time-series |
fitted.shape |
point shape for fitted time-series |
predict.geom |
geometric string for predicted time-series |
predict.colour |
line colour for predicted time-series |
predict.size |
point size for predicted time-series |
predict.linetype |
line type for predicted time-series |
predict.alpha |
alpha for predicted time-series |
predict.fill |
fill colour for predicted time-series |
predict.shape |
point shape for predicted time-series |
conf.int |
Logical flag indicating whether to plot confidence intervals |
conf.int.colour |
line colour for confidence intervals |
conf.int.linetype |
line type for confidence intervals |
conf.int.fill |
fill colour for confidence intervals |
conf.int.alpha |
alpha for confidence intervals |
... |
Keywords passed to |
ggplot
## Not run: d.ar <- stats::ar(AirPassengers) autoplot(d.ar) autoplot(d.ar, predict = predict(d.ar, n.ahead = 5)) autoplot(stats::arima(UKgas), data = UKgas) autoplot(forecast::arfima(AirPassengers)) autoplot(forecast::nnetar(UKgas), is.date = FALSE) d.holt <- stats::HoltWinters(USAccDeaths) autoplot(d.holt) autoplot(d.holt, predict = predict(d.holt, n.ahead = 5)) autoplot(d.holt, predict = predict(d.holt, n.ahead = 5, prediction.interval = TRUE)) ## End(Not run)
## Not run: d.ar <- stats::ar(AirPassengers) autoplot(d.ar) autoplot(d.ar, predict = predict(d.ar, n.ahead = 5)) autoplot(stats::arima(UKgas), data = UKgas) autoplot(forecast::arfima(AirPassengers)) autoplot(forecast::nnetar(UKgas), is.date = FALSE) d.holt <- stats::HoltWinters(USAccDeaths) autoplot(d.holt) autoplot(d.holt, predict = predict(d.holt, n.ahead = 5)) autoplot(d.holt, predict = predict(d.holt, n.ahead = 5, prediction.interval = TRUE)) ## End(Not run)
vars::varprd
Autoplot vars::varprd
## S3 method for class 'varprd' autoplot( object, is.date = NULL, ts.connect = TRUE, scales = "free_y", predict.geom = "line", predict.colour = "#0000FF", predict.size = NULL, predict.linetype = NULL, predict.alpha = NULL, predict.fill = NULL, predict.shape = NULL, conf.int = TRUE, conf.int.colour = "#0000FF", conf.int.linetype = "none", conf.int.fill = "#000000", conf.int.alpha = 0.3, ... )
## S3 method for class 'varprd' autoplot( object, is.date = NULL, ts.connect = TRUE, scales = "free_y", predict.geom = "line", predict.colour = "#0000FF", predict.size = NULL, predict.linetype = NULL, predict.alpha = NULL, predict.fill = NULL, predict.shape = NULL, conf.int = TRUE, conf.int.colour = "#0000FF", conf.int.linetype = "none", conf.int.fill = "#000000", conf.int.alpha = 0.3, ... )
object |
|
is.date |
Logical frag indicates whether the |
ts.connect |
Logical frag indicates whether connects original time-series and predicted values |
scales |
Scale value passed to |
predict.geom |
geometric string for predicted time-series |
predict.colour |
line colour for predicted time-series |
predict.size |
point size for predicted time-series |
predict.linetype |
line type for predicted time-series |
predict.alpha |
alpha for predicted time-series |
predict.fill |
fill colour for predicted time-series |
predict.shape |
point shape for predicted time-series |
conf.int |
Logical flag indicating whether to plot confidence intervals |
conf.int.colour |
line colour for confidence intervals |
conf.int.linetype |
line type for confidence intervals |
conf.int.fill |
fill colour for confidence intervals |
conf.int.alpha |
alpha for confidence intervals |
... |
other arguments passed to |
ggplot
## Not run: data(Canada, package = 'vars') d.var <- vars::VAR(Canada, p = 3, type = 'const') autoplot(stats::predict(d.var, n.ahead = 50), is.date = TRUE) autoplot(stats::predict(d.var, n.ahead = 50), conf.int = FALSE) ## End(Not run)
## Not run: data(Canada, package = 'vars') d.var <- vars::VAR(Canada, p = 3, type = 'const') autoplot(stats::predict(d.var, n.ahead = 50), is.date = TRUE) autoplot(stats::predict(d.var, n.ahead = 50), conf.int = FALSE) ## End(Not run)
Wrapper for cbind
cbind_wraps(df1, df2)
cbind_wraps(df1, df2)
df1 |
1st data |
df2 |
2nd data |
list
ggfortify:::cbind_wraps(iris[1:2], iris[3:5])
ggfortify:::cbind_wraps(iris[1:2], iris[3:5])
Check data names are equal with expected
check_names(data, expected)
check_names(data, expected)
data |
|
expected |
expected character vector |
logical
stats::acf
Calculate confidence interval for stats::acf
## S3 method for class 'acf' confint(x, ci = 0.95, ci.type = "white")
## S3 method for class 'acf' confint(x, ci = 0.95, ci.type = "white")
x |
|
ci |
Float value for confidence interval |
ci.type |
"white" or "ma" |
vector
## Not run: air.acf <- acf(AirPassengers, plot = FALSE) ggfortify:::confint.acf(air.acf) ggfortify:::confint.acf(air.acf, ci.type = 'ma') ## End(Not run)
## Not run: air.acf <- acf(AirPassengers, plot = FALSE) ggfortify:::confint.acf(air.acf) ggfortify:::confint.acf(air.acf, ci.type = 'ma') ## End(Not run)
Show deprecate warning
deprecate.warning(old.kw, new.kw)
deprecate.warning(old.kw, new.kw)
old.kw |
Keyword being deprecated |
new.kw |
Keyword being replaced |
ggfortify:::deprecate.warning('old', 'new')
ggfortify:::deprecate.warning('old', 'new')
stats::ar
Calculate fitted values for stats::ar
## S3 method for class 'ar' fitted(object, ...)
## S3 method for class 'ar' fitted(object, ...)
object |
|
... |
other keywords |
ts An time series of the one-step forecasts
## Not run: fitted(ar(WWWusage)) ## End(Not run)
## Not run: fitted(ar(WWWusage)) ## End(Not run)
tains list or matrix as column
flatten(df)
flatten(df)
df |
|
base::table
to data.frame
Convert base::table
to data.frame
fortify_base(model, data, ...)
fortify_base(model, data, ...)
model |
|
data |
original dataset, if needed |
... |
other arguments passed to methods |
data.frame
maps::map
to data.frame
.Convert maps::map
to data.frame
.
fortify_map(model, data = NULL, ...)
fortify_map(model, data = NULL, ...)
model |
|
data |
original dataset, if needed |
... |
other arguments passed to methods |
data.frame
survival::aareg
to data.frame
Convert survival::aareg
to data.frame
## S3 method for class 'aareg' fortify( model, data = NULL, maxtime = NULL, surv.connect = TRUE, melt = FALSE, ... )
## S3 method for class 'aareg' fortify( model, data = NULL, maxtime = NULL, surv.connect = TRUE, melt = FALSE, ... )
model |
|
data |
original dataset, if needed |
maxtime |
truncate the input to the model at time "maxtime" |
surv.connect |
logical frag indicates whether connects survival curve to the origin |
melt |
Logical flag indicating whether to melt each timeseries as variable |
... |
other arguments passed to methods |
data.frame
## Not run: if (requireNamespace("survival", quietly = TRUE)) { fortify(aareg(Surv(time, status) ~ age + sex + ph.ecog, data = lung, nmin = 1)) fortify(aareg(Surv(time, status) ~ age + sex + ph.ecog, data = lung, nmin = 1), melt = TRUE) } ## End(Not run)
## Not run: if (requireNamespace("survival", quietly = TRUE)) { fortify(aareg(Surv(time, status) ~ age + sex + ph.ecog, data = lung, nmin = 1)) fortify(aareg(Surv(time, status) ~ age + sex + ph.ecog, data = lung, nmin = 1), melt = TRUE) } ## End(Not run)
stats::acf
to data.frame
Convert stats::acf
to data.frame
## S3 method for class 'acf' fortify( model, data = NULL, conf.int = TRUE, conf.int.value = 0.95, conf.int.type = "white", ... )
## S3 method for class 'acf' fortify( model, data = NULL, conf.int = TRUE, conf.int.value = 0.95, conf.int.type = "white", ... )
model |
|
data |
original dataset, if needed |
conf.int |
Logical flag indicating whether to attach confidence intervals |
conf.int.value |
Coverage probability for confidence interval |
conf.int.type |
Type of confidence interval, 'white' for white noise or 'ma' MA(k-1) model |
... |
other arguments passed to methods |
data.frame
## Not run: fortify(stats::acf(AirPassengers)) fortify(stats::pacf(AirPassengers)) fortify(stats::ccf(AirPassengers, AirPassengers)) fortify(stats::acf(AirPassengers), conf.int = TRUE) ## End(Not run)
## Not run: fortify(stats::acf(AirPassengers)) fortify(stats::pacf(AirPassengers)) fortify(stats::ccf(AirPassengers, AirPassengers)) fortify(stats::acf(AirPassengers), conf.int = TRUE) ## End(Not run)
data.frame
Convert spline basis instances to data.frame
## S3 method for class 'basis' fortify(model, data, n = 256, ...)
## S3 method for class 'basis' fortify(model, data, n = 256, ...)
model |
spline basis object |
data |
x-values at which to evaluate the splines. Optional. By default, an evenly spaced sequence of 256 values covering the range of the splines will be used. |
n |
If data is not provided, instead use an evenly-spaced sequence of x-values of this length (plus one, since both endpoints are included). If data is provided, this argument is ignored. |
... |
other arguments passed to methods |
data.frame with 3 columns: Spline (character), x (numeric), and y (numeric); giving the interpolated x and y values for each of the splines in the basis.
## Not run: library(splines) x <- seq(0, 1, by=0.001) spl <- bs(x, df=6) fortify(spl) ## End(Not run)
## Not run: library(splines) x <- seq(0, 1, by=0.001) spl <- bs(x, df=6) fortify(spl) ## End(Not run)
changepoint::cpt
and strucchange::breakpoints
to data.frame
Convert changepoint::cpt
and strucchange::breakpoints
to data.frame
## S3 method for class 'cpt' fortify(model, data = NULL, is.date = NULL, ...)
## S3 method for class 'cpt' fortify(model, data = NULL, is.date = NULL, ...)
model |
|
data |
original dataset, if needed |
is.date |
Logical frag indicates whether the |
... |
other arguments passed to methods |
data.frame
## Not run: library(changepoint) fortify(cpt.mean(AirPassengers)) fortify(cpt.var(AirPassengers)) fortify(cpt.meanvar(AirPassengers)) library(strucchange) bp.nile <- breakpoints(Nile ~ 1) fortify(bp.nile) fortify(breakpoints(bp.nile, breaks = 2)) fortify(breakpoints(bp.nile, breaks = 2), data = Nile) ## End(Not run)
## Not run: library(changepoint) fortify(cpt.mean(AirPassengers)) fortify(cpt.var(AirPassengers)) fortify(cpt.meanvar(AirPassengers)) library(strucchange) bp.nile <- breakpoints(Nile ~ 1) fortify(bp.nile) fortify(breakpoints(bp.nile, breaks = 2)) fortify(breakpoints(bp.nile, breaks = 2), data = Nile) ## End(Not run)
glmnet::cv.glmnet
to data.frame
Convert glmnet::cv.glmnet
to data.frame
## S3 method for class 'cv.glmnet' fortify(model, data = NULL, ...)
## S3 method for class 'cv.glmnet' fortify(model, data = NULL, ...)
model |
|
data |
original dataset, if needed |
... |
other arguments passed to methods |
data.frame
if (requireNamespace("survival", quietly = TRUE)) { fortify(glmnet::cv.glmnet(data.matrix(Orange[-3]), data.matrix(Orange[3]))) }
if (requireNamespace("survival", quietly = TRUE)) { fortify(glmnet::cv.glmnet(data.matrix(Orange[-3]), data.matrix(Orange[3]))) }
stats::density
to data.frame
Convert stats::density
to data.frame
## S3 method for class 'density' fortify(model, data = NULL, ...)
## S3 method for class 'density' fortify(model, data = NULL, ...)
model |
|
data |
original dataset, if needed |
... |
other arguments passed to methods |
data.frame
fortify(stats::density(stats::rnorm(1:50)))
fortify(stats::density(stats::rnorm(1:50)))
stats::dist
to data.frame
Convert stats::dist
to data.frame
## S3 method for class 'dist' fortify(model, data = NULL, ...)
## S3 method for class 'dist' fortify(model, data = NULL, ...)
model |
|
data |
original dataset, if needed |
... |
other arguments passed to methods |
data.frame
fortify(eurodist)
fortify(eurodist)
forecast::bats
and forecast::ets
to data.frame
Convert forecast::bats
and forecast::ets
to data.frame
## S3 method for class 'ets' fortify(model, data = NULL, ...)
## S3 method for class 'ets' fortify(model, data = NULL, ...)
model |
|
data |
original dataset, if needed |
... |
other arguments passed to methods |
data.frame
## Not run: fortify(forecast::bats(UKgas)) fortify(forecast::ets(UKgas)) ## End(Not run)
## Not run: fortify(forecast::bats(UKgas)) fortify(forecast::ets(UKgas)) ## End(Not run)
stats::factanal
to data.frame
Convert stats::factanal
to data.frame
## S3 method for class 'factanal' fortify(model, data = NULL, ...)
## S3 method for class 'factanal' fortify(model, data = NULL, ...)
model |
|
data |
original dataset, if needed |
... |
other arguments passed to methods |
data.frame
## Not run: d.factanal <- stats::factanal(state.x77, factors = 3, scores = 'regression') fortify(d.factanal) fortify(d.factanal, data = state.x77) ## End(Not run)
## Not run: d.factanal <- stats::factanal(state.x77, factors = 3, scores = 'regression') fortify(d.factanal) fortify(d.factanal, data = state.x77) ## End(Not run)
forecast::forecast
to data.frame
Convert forecast::forecast
to data.frame
## S3 method for class 'forecast' fortify(model, data = NULL, is.date = NULL, ts.connect = FALSE, ...)
## S3 method for class 'forecast' fortify(model, data = NULL, is.date = NULL, ts.connect = FALSE, ...)
model |
|
data |
original dataset, if needed |
is.date |
Logical frag indicates whether the |
ts.connect |
Logical frag indicates whether connects original time-series and predicted values |
... |
other arguments passed to methods |
data.frame
## Not run: d.arima <- forecast::auto.arima(AirPassengers) d.forecast <- forecast::forecast(d.arima, level = c(95), h = 50) fortify(d.forecast) fortify(d.forecast, ts.connect = TRUE) ## End(Not run)
## Not run: d.arima <- forecast::auto.arima(AirPassengers) d.forecast <- forecast::forecast(d.arima, level = c(95), h = 50) fortify(d.forecast) fortify(d.forecast, ts.connect = TRUE) ## End(Not run)
glmnet::glmnet
to data.frame
Convert glmnet::glmnet
to data.frame
## S3 method for class 'glmnet' fortify(model, data = NULL, ...)
## S3 method for class 'glmnet' fortify(model, data = NULL, ...)
model |
|
data |
original dataset, if needed |
... |
other arguments passed to methods |
data.frame
## Not run: fortify(glmnet::glmnet(data.matrix(Orange[-3]), data.matrix(Orange[3]))) ## End(Not run)
## Not run: fortify(glmnet::glmnet(data.matrix(Orange[-3]), data.matrix(Orange[3]))) ## End(Not run)
data.frame
Convert cluster instances to data.frame
## S3 method for class 'kmeans' fortify(model, data = NULL, ...)
## S3 method for class 'kmeans' fortify(model, data = NULL, ...)
model |
Clustered instance |
data |
original dataset, if needed |
... |
other arguments passed to methods |
data.frame
## Not run: fortify(stats::kmeans(iris[-5], 3)) fortify(stats::kmeans(iris[-5], 3), data = iris) fortify(cluster::clara(iris[-5], 3)) fortify(cluster::fanny(iris[-5], 3)) fortify(cluster::pam(iris[-5], 3), data = iris) ## End(Not run)
## Not run: fortify(stats::kmeans(iris[-5], 3)) fortify(stats::kmeans(iris[-5], 3), data = iris) fortify(cluster::clara(iris[-5], 3)) fortify(cluster::fanny(iris[-5], 3)) fortify(cluster::pam(iris[-5], 3), data = iris) ## End(Not run)
lfda::lfda
or lfda::klfda
or lfda::self
to data.frame
Convert lfda::lfda
or lfda::klfda
or lfda::self
to data.frame
## S3 method for class 'lfda' fortify(model, data = NULL, ...)
## S3 method for class 'lfda' fortify(model, data = NULL, ...)
model |
|
data |
original dataset, if needed |
... |
other arguments passed to methods |
data.frame
## Not run: model <- lfda::lfda(iris[, -5], iris[, 5], 3, metric = "plain") fortify(model) ## End(Not run)
## Not run: model <- lfda::lfda(iris[, -5], iris[, 5], 3, metric = "plain") fortify(model) ## End(Not run)
Convert list to data.frame
## S3 method for class 'list' fortify(model, data = NULL, ...)
## S3 method for class 'list' fortify(model, data = NULL, ...)
model |
|
data |
original dataset, if needed |
... |
other arguments passed to methods |
data.frame
base::matrix
to data.frame
Different from as.data.frame
## S3 method for class 'matrix' fortify(model, data = NULL, compat = FALSE, ...)
## S3 method for class 'matrix' fortify(model, data = NULL, compat = FALSE, ...)
model |
|
data |
original dataset, if needed |
compat |
Logical frag to specify the behaviour when converting matrix which has no column name.
If |
... |
other arguments passed to methods |
data.frame
fortify(matrix(1:6, nrow=2, ncol=3))
fortify(matrix(1:6, nrow=2, ncol=3))
MSwM::MSM.lm
to data.frame
Convert MSwM::MSM.lm
to data.frame
## S3 method for class 'MSM.lm' fortify(model, data = NULL, melt = FALSE, ...)
## S3 method for class 'MSM.lm' fortify(model, data = NULL, melt = FALSE, ...)
model |
|
data |
original dataset, if needed |
melt |
Logical flag indicating whether to melt each models |
... |
other arguments passed to methods |
data.frame
## Not run: library(MSwM) d <- data.frame(Data = c(rnorm(50, mean = -10), rnorm(50, mean = 10)), exog = cos(seq(-pi/2, pi/2, length.out = 100))) d.mswm <- MSwM::msmFit(lm(Data ~.-1, data = d), k=2, sw=rep(TRUE, 2), control = list(parallelization = FALSE)) fortify(d.mswm) ## End(Not run)
## Not run: library(MSwM) d <- data.frame(Data = c(rnorm(50, mean = -10), rnorm(50, mean = 10)), exog = cos(seq(-pi/2, pi/2, length.out = 100))) d.mswm <- MSwM::msmFit(lm(Data ~.-1, data = d), k=2, sw=rep(TRUE, 2), control = list(parallelization = FALSE)) fortify(d.mswm) ## End(Not run)
ROCR::performance
objects to data.frame
Convert ROCR::performance
objects to data.frame
## S3 method for class 'performance' fortify(model, data = NULL, ...)
## S3 method for class 'performance' fortify(model, data = NULL, ...)
model |
|
data |
original dataset, if needed |
... |
other arguments passed to methods |
data.frame
stats::prcomp
, stats::princomp
to data.frame
Convert stats::prcomp
, stats::princomp
to data.frame
## S3 method for class 'prcomp' fortify(model, data = NULL, ...)
## S3 method for class 'prcomp' fortify(model, data = NULL, ...)
model |
|
data |
original dataset, if needed |
... |
other arguments passed to methods |
data.frame
## Not run: fortify(stats::prcomp(iris[-5])) fortify(stats::prcomp(iris[-5]), data = iris) fortify(stats::princomp(iris[-5])) fortify(stats::princomp(iris[-5]), data = iris) ## End(Not run)
## Not run: fortify(stats::prcomp(iris[-5])) fortify(stats::prcomp(iris[-5]), data = iris) fortify(stats::princomp(iris[-5])) fortify(stats::princomp(iris[-5]), data = iris) ## End(Not run)
raster
to data.frame
Convert raster
to data.frame
## S3 method for class 'RasterCommon' fortify(model, data = NULL, maxpixels = 1e+05, rename = TRUE, ...)
## S3 method for class 'RasterCommon' fortify(model, data = NULL, maxpixels = 1e+05, rename = TRUE, ...)
model |
|
data |
original dataset, if needed |
maxpixels |
number of pixels for resampling |
rename |
logical flag indicating whether to rename coordinates to long and lat |
... |
other arguments passed to methods |
data.frame
cluster::silhouette
to data.frame
Convert cluster::silhouette
to data.frame
## S3 method for class 'silhouette' fortify(model, data = NULL, ...)
## S3 method for class 'silhouette' fortify(model, data = NULL, ...)
model |
Silhouette instance |
data |
original dataset, if needed |
... |
other arguments passed to methods |
data.frame
## Not run: fortify(cluster::silhouette(cluster::pam(iris[-5], 3))) fortify(cluster::silhouette(cluster::clara(iris[-5], 3))) fortify(cluster::silhouette(cluster::fanny(iris[-5], 3))) mod = stats::kmeans(iris[-5], 3) fortify(cluster::silhouette(mod$cluster, stats::dist(iris[-5]))) ## End(Not run)
## Not run: fortify(cluster::silhouette(cluster::pam(iris[-5], 3))) fortify(cluster::silhouette(cluster::clara(iris[-5], 3))) fortify(cluster::silhouette(cluster::fanny(iris[-5], 3))) mod = stats::kmeans(iris[-5], 3) fortify(cluster::silhouette(mod$cluster, stats::dist(iris[-5]))) ## End(Not run)
sp
instances to data.frame
.Convert sp
instances to data.frame
.
## S3 method for class 'SpatialCommon' fortify(model, data = NULL, rename = TRUE, ...)
## S3 method for class 'SpatialCommon' fortify(model, data = NULL, rename = TRUE, ...)
model |
|
data |
original dataset, if needed |
rename |
logical flag indicating whether to rename coordinates to long and lat |
... |
other arguments passed to methods |
data.frame
stats::spec
to data.frame
Convert stats::spec
to data.frame
## S3 method for class 'spec' fortify(model, data = NULL, ...)
## S3 method for class 'spec' fortify(model, data = NULL, ...)
model |
|
data |
original dataset, if needed |
... |
other arguments passed to methods |
data.frame
## Not run: fortify(spectrum(AirPassengers)) fortify(stats::spec.ar(AirPassengers)) fortify(stats::spec.pgram(AirPassengers)) ## End(Not run)
## Not run: fortify(spectrum(AirPassengers)) fortify(stats::spec.ar(AirPassengers)) fortify(stats::spec.pgram(AirPassengers)) ## End(Not run)
stats::stepfun
to data.frame
Convert stats::stepfun
to data.frame
## S3 method for class 'stepfun' fortify(model, data, ...)
## S3 method for class 'stepfun' fortify(model, data, ...)
model |
|
data |
original dataset, if needed |
... |
other arguments passed to methods |
data.frame
fortify(stepfun(c(1, 2, 3), c(4, 5, 6, 7))) fortify(stepfun(c(1), c(4, 5))) fortify(stepfun(c(1, 3, 4, 8), c(4, 5, 2, 3, 5))) fortify(stepfun(c(1, 2, 3, 4, 5, 6, 7, 8, 10), c(4, 5, 6, 7, 8, 9, 10, 11, 12, 9)))
fortify(stepfun(c(1, 2, 3), c(4, 5, 6, 7))) fortify(stepfun(c(1), c(4, 5))) fortify(stepfun(c(1, 3, 4, 8), c(4, 5, 2, 3, 5))) fortify(stepfun(c(1, 2, 3, 4, 5, 6, 7, 8, 10), c(4, 5, 6, 7, 8, 9, 10, 11, 12, 9)))
survival::survfit
to data.frame
Convert survival::survfit
to data.frame
## S3 method for class 'survfit' fortify(model, data = NULL, surv.connect = FALSE, fun = NULL, ...)
## S3 method for class 'survfit' fortify(model, data = NULL, surv.connect = FALSE, fun = NULL, ...)
model |
|
data |
original dataset, if needed |
surv.connect |
logical frag indicates whether connects survival curve to the origin |
fun |
an arbitrary function defining a transformation of the survival curve |
... |
other arguments passed to methods |
data.frame
## Not run: if (requireNamespace("survival", quietly = TRUE)) { fortify(survfit(Surv(time, status) ~ sex, data = lung)) fortify(survfit(Surv(time, status) ~ 1, data = lung)) fortify(survfit(coxph(Surv(time, status) ~ sex, data = lung))) fortify(survfit(coxph(Surv(time, status) ~ 1, data = lung))) } ## End(Not run)
## Not run: if (requireNamespace("survival", quietly = TRUE)) { fortify(survfit(Surv(time, status) ~ sex, data = lung)) fortify(survfit(Surv(time, status) ~ 1, data = lung)) fortify(survfit(coxph(Surv(time, status) ~ sex, data = lung))) fortify(survfit(coxph(Surv(time, status) ~ 1, data = lung))) } ## End(Not run)
base::table
to data.frame
Convert base::table
to data.frame
## S3 method for class 'table' fortify(model, data, ...)
## S3 method for class 'table' fortify(model, data, ...)
model |
|
data |
original dataset, if needed |
... |
other arguments passed to methods |
data.frame
fortify(Titanic)
fortify(Titanic)
Convert time-series-like to data.frame
## S3 method for class 'ts' fortify( model, data = NULL, columns = NULL, is.date = NULL, index.name = "Index", data.name = "Data", scale = FALSE, melt = FALSE, ... )
## S3 method for class 'ts' fortify( model, data = NULL, columns = NULL, is.date = NULL, index.name = "Index", data.name = "Data", scale = FALSE, melt = FALSE, ... )
model |
time-series-like instance |
data |
original dataset, if needed |
columns |
character vector specifies target column name(s) |
is.date |
logical frag indicates whether the |
index.name |
specify column name for time series index |
data.name |
specify column name for univariate time series data. Ignored in multivariate time series. |
scale |
logical flag indicating whether to perform scaling each timeseries |
melt |
logical flag indicating whether to melt each timeseries as variable |
... |
other arguments passed to methods |
data.frame
## Not run: fortify(AirPassengers) fortify(timeSeries::as.timeSeries(AirPassengers)) fortify(tseries::irts(cumsum(rexp(10, rate = 0.1)), matrix(rnorm(20), ncol=2))) fortify(stats::stl(UKgas, s.window = 'periodic')) fortify(stats::decompose(UKgas)) ## End(Not run)
## Not run: fortify(AirPassengers) fortify(timeSeries::as.timeSeries(AirPassengers)) fortify(tseries::irts(cumsum(rexp(10, rate = 0.1)), matrix(rnorm(20), ncol=2))) fortify(stats::stl(UKgas, s.window = 'periodic')) fortify(stats::decompose(UKgas)) ## End(Not run)
data.frame
Convert time series models (like AR, ARIMA) to data.frame
## S3 method for class 'tsmodel' fortify( model, data = NULL, predict = NULL, is.date = NULL, ts.connect = TRUE, ... )
## S3 method for class 'tsmodel' fortify( model, data = NULL, predict = NULL, is.date = NULL, ts.connect = TRUE, ... )
model |
Time series model instance |
data |
original dataset, needed for |
predict |
Predicted |
is.date |
Logical frag indicates whether the |
ts.connect |
Logical frag indicates whether connects original time-series and predicted values |
... |
other arguments passed to methods |
data.frame
## Not run: fortify(stats::ar(AirPassengers)) fortify(stats::arima(UKgas)) fortify(stats::arima(UKgas), data = UKgas, is.date = TRUE) fortify(forecast::auto.arima(austres)) fortify(forecast::arfima(AirPassengers)) fortify(forecast::nnetar(UKgas)) fortify(stats::HoltWinters(USAccDeaths)) data(LPP2005REC, package = 'timeSeries') x = timeSeries::as.timeSeries(LPP2005REC) d.Garch = fGarch::garchFit(LPP40 ~ garch(1, 1), data = 100 * x, trace = FALSE) fortify(d.Garch) ## End(Not run)
## Not run: fortify(stats::ar(AirPassengers)) fortify(stats::arima(UKgas)) fortify(stats::arima(UKgas), data = UKgas, is.date = TRUE) fortify(forecast::auto.arima(austres)) fortify(forecast::arfima(AirPassengers)) fortify(forecast::nnetar(UKgas)) fortify(stats::HoltWinters(USAccDeaths)) data(LPP2005REC, package = 'timeSeries') x = timeSeries::as.timeSeries(LPP2005REC) d.Garch = fGarch::garchFit(LPP40 ~ garch(1, 1), data = 100 * x, trace = FALSE) fortify(d.Garch) ## End(Not run)
vars::varprd
to data.frame
Convert vars::varprd
to data.frame
## S3 method for class 'varprd' fortify( model, data = NULL, is.date = NULL, ts.connect = FALSE, melt = FALSE, ... )
## S3 method for class 'varprd' fortify( model, data = NULL, is.date = NULL, ts.connect = FALSE, melt = FALSE, ... )
model |
|
data |
original dataset, if needed |
is.date |
Logical frag indicates whether the |
ts.connect |
Logical frag indicates whether connects original time-series and predicted values |
melt |
Logical flag indicating whether to melt each timeseries as variable |
... |
other arguments passed to methods |
data.frame
## Not run: data(Canada, package = 'vars') d.var <- vars::VAR(Canada, p = 3, type = 'const') fortify(stats::predict(d.var, n.ahead = 50)) ## End(Not run)
## Not run: data(Canada, package = 'vars') d.var <- vars::VAR(Canada, p = 3, type = 'const') fortify(stats::predict(d.var, n.ahead = 50)) ## End(Not run)
Connect observations by stairs.
geom_confint( mapping = NULL, data = NULL, stat = "identity", position = "identity", na.rm = FALSE, ... )
geom_confint( mapping = NULL, data = NULL, stat = "identity", position = "identity", na.rm = FALSE, ... )
mapping |
the aesthetic mapping |
data |
a layer specific dataset |
stat |
the statistical transformation to use on the data for this layer |
position |
the position adjustment to use for overlapping points on this layer |
na.rm |
logical frag whether silently remove missing values |
... |
other arguments passed to methods |
ggplot2::geom_xxx
functionsFactory function to control ggplot2::geom_xxx
functions
geom_factory(geomfunc, data = NULL, position = NULL, ...)
geom_factory(geomfunc, data = NULL, position = NULL, ...)
geomfunc |
|
data |
plotting data |
position |
A position function or character |
... |
other arguments passed to methods |
proto
ggplot2::geom_xxx
functionsFactory function to control ggplot2::geom_xxx
functions
get_geom_function(geom, allowed = c("line", "bar", "point"))
get_geom_function(geom, allowed = c("line", "bar", "point"))
geom |
string representation of |
allowed |
character vector contains allowed values |
function
ggfortify:::get_geom_function('point') ggfortify:::get_geom_function('line', allowed = c('line'))
ggfortify:::get_geom_function('point') ggfortify:::get_geom_function('line', allowed = c('line'))
ts
index to Date
vector
Convert ts
index to Date
vector
get.dtindex(data, is.tsp = FALSE, is.date = NULL)
get.dtindex(data, is.tsp = FALSE, is.date = NULL)
data |
|
is.tsp |
Logical frag whether data is |
is.date |
Logical frag indicates whether the |
vector
## Not run: ggfortify:::get.dtindex(AirPassengers) ggfortify:::get.dtindex(UKgas) ggfortify:::get.dtindex(Nile, is.date = FALSE) ggfortify:::get.dtindex(Nile, is.date = TRUE) ## End(Not run)
## Not run: ggfortify:::get.dtindex(AirPassengers) ggfortify:::get.dtindex(UKgas) ggfortify:::get.dtindex(Nile, is.date = FALSE) ggfortify:::get.dtindex(Nile, is.date = TRUE) ## End(Not run)
Date
vector
continue to ts
indexGet Date
vector
continue to ts
index
get.dtindex.continuous(data, length, is.tsp = FALSE, is.date = NULL)
get.dtindex.continuous(data, length, is.tsp = FALSE, is.date = NULL)
data |
|
length |
A number to continue |
is.tsp |
Logical frag whether data is |
is.date |
Logical frag indicates whether the |
vector
## Not run: ggfortify:::get.dtindex.continuous(AirPassengers, length = 10) ggfortify:::get.dtindex.continuous(UKgas, length = 10) ## End(Not run)
## Not run: ggfortify:::get.dtindex.continuous(AirPassengers, length = 10) ggfortify:::get.dtindex.continuous(UKgas, length = 10) ## End(Not run)
ggmultiplot
Calcurate layout matrix for ggmultiplot
get.layout(nplots, ncol, nrow)
get.layout(nplots, ncol, nrow)
nplots |
Number of plots |
ncol |
Number of grid columns |
nrow |
Number of grid rows |
matrix
ggfortify:::get.layout(3, 2, 2)
ggfortify:::get.layout(3, 2, 2)
biplot
using ggplot2
.Draw biplot
using ggplot2
.
ggbiplot( plot.data, loadings.data = NULL, colour = NULL, size = NULL, linetype = NULL, alpha = NULL, fill = NULL, shape = NULL, label = FALSE, label.label = "rownames", label.colour = colour, label.alpha = NULL, label.size = NULL, label.angle = NULL, label.family = NULL, label.fontface = NULL, label.lineheight = NULL, label.hjust = NULL, label.vjust = NULL, label.repel = FALSE, label.position = "identity", loadings = FALSE, loadings.arrow = grid::arrow(length = grid::unit(8, "points")), loadings.colour = "#FF0000", loadings.linewidth = 0.5, loadings.label = FALSE, loadings.label.label = "rownames", loadings.label.colour = "#FF0000", loadings.label.alpha = NULL, loadings.label.size = NULL, loadings.label.angle = NULL, loadings.label.family = NULL, loadings.label.fontface = NULL, loadings.label.lineheight = NULL, loadings.label.hjust = NULL, loadings.label.vjust = NULL, loadings.label.repel = FALSE, label.show.legend = NA, frame = FALSE, frame.type = NULL, frame.colour = colour, frame.level = 0.95, frame.alpha = 0.2, xlim = c(NA, NA), ylim = c(NA, NA), log = "", main = NULL, xlab = NULL, ylab = NULL, asp = NULL, ... )
ggbiplot( plot.data, loadings.data = NULL, colour = NULL, size = NULL, linetype = NULL, alpha = NULL, fill = NULL, shape = NULL, label = FALSE, label.label = "rownames", label.colour = colour, label.alpha = NULL, label.size = NULL, label.angle = NULL, label.family = NULL, label.fontface = NULL, label.lineheight = NULL, label.hjust = NULL, label.vjust = NULL, label.repel = FALSE, label.position = "identity", loadings = FALSE, loadings.arrow = grid::arrow(length = grid::unit(8, "points")), loadings.colour = "#FF0000", loadings.linewidth = 0.5, loadings.label = FALSE, loadings.label.label = "rownames", loadings.label.colour = "#FF0000", loadings.label.alpha = NULL, loadings.label.size = NULL, loadings.label.angle = NULL, loadings.label.family = NULL, loadings.label.fontface = NULL, loadings.label.lineheight = NULL, loadings.label.hjust = NULL, loadings.label.vjust = NULL, loadings.label.repel = FALSE, label.show.legend = NA, frame = FALSE, frame.type = NULL, frame.colour = colour, frame.level = 0.95, frame.alpha = 0.2, xlim = c(NA, NA), ylim = c(NA, NA), log = "", main = NULL, xlab = NULL, ylab = NULL, asp = NULL, ... )
plot.data |
data.frame |
loadings.data |
data.frame |
colour |
colour |
size |
size |
linetype |
line type |
alpha |
alpha |
fill |
fill |
shape |
shape |
label |
Logical value whether to display data labels |
label.label |
Column name used for label text |
label.colour |
Colour for text labels |
label.alpha |
Alpha for text labels |
label.size |
Size for text labels |
label.angle |
Angle for text labels |
label.family |
Font family for text labels |
label.fontface |
Fontface for text labels |
label.lineheight |
Lineheight for text labels |
label.hjust |
Horizontal adjustment for text labels |
label.vjust |
Vertical adjustment for text labels |
label.repel |
Logical flag indicating whether to use |
label.position |
Character or a position function |
loadings |
Logical value whether to display loadings arrows |
loadings.arrow |
An arrow definition |
loadings.colour |
Point colour for data |
loadings.linewidth |
Segment linewidth for loadings |
loadings.label |
Logical value whether to display loadings labels |
loadings.label.label |
Column name used for loadings text labels |
loadings.label.colour |
Colour for loadings text labels |
loadings.label.alpha |
Alpha for loadings text labels |
loadings.label.size |
Size for loadings text labels |
loadings.label.angle |
Angle for loadings text labels |
loadings.label.family |
Font family for loadings text labels |
loadings.label.fontface |
Fontface for loadings text labels |
loadings.label.lineheight |
Lineheight for loadings text labels |
loadings.label.hjust |
Horizontal adjustment for loadings text labels |
loadings.label.vjust |
Vertical adjustment for loadings text labels |
loadings.label.repel |
Logical flag indicating whether to use |
label.show.legend |
Logical value indicating whether to show the legend of text labels |
frame |
Logical value whether to draw outliner convex / ellipse |
frame.type |
Character specifying frame type.
'convex' or types supporeted by |
frame.colour |
Colour for frame |
frame.level |
Passed for |
frame.alpha |
Alpha for frame |
xlim |
limits for x axis |
ylim |
limits for y axis |
log |
which variables to log transform ("x", "y", or "xy") |
main |
character vector or expression for plot title |
xlab |
character vector or expression for x axis label |
ylab |
character vector or expression for y axis label |
asp |
the y/x aspect ratio |
... |
other arguments passed to methods |
ggplot
Plots a cumulative periodogram
ggcpgram( ts, taper = 0.1, colour = "#000000", linetype = "solid", conf.int = TRUE, conf.int.colour = "#0000FF", conf.int.linetype = "dashed", conf.int.fill = NULL, conf.int.alpha = 0.3 )
ggcpgram( ts, taper = 0.1, colour = "#000000", linetype = "solid", conf.int = TRUE, conf.int.colour = "#0000FF", conf.int.linetype = "dashed", conf.int.fill = NULL, conf.int.alpha = 0.3 )
ts |
|
taper |
Proportion tapered in forming the periodogram |
colour |
Line colour |
linetype |
Line type |
conf.int |
Logical flag indicating whether to plot confidence intervals |
conf.int.colour |
line colour for confidence intervals |
conf.int.linetype |
line type for confidence intervals |
conf.int.fill |
fill colour for confidence intervals |
conf.int.alpha |
alpha for confidence intervals |
ggplot
## Not run: ggcpgram(AirPassengers) ## End(Not run)
## Not run: ggcpgram(AirPassengers) ## End(Not run)
Plot distribution
ggdistribution( func, x, p = NULL, colour = "#000000", linetype = NULL, fill = NULL, alpha = NULL, xlim = c(NA, NA), ylim = c(NA, NA), log = "", main = NULL, xlab = NULL, ylab = NULL, asp = NULL, ... )
ggdistribution( func, x, p = NULL, colour = "#000000", linetype = NULL, fill = NULL, alpha = NULL, xlim = c(NA, NA), ylim = c(NA, NA), log = "", main = NULL, xlab = NULL, ylab = NULL, asp = NULL, ... )
func |
PDF or CDF function |
x |
Numeric vector to be passed to func |
p |
|
colour |
Line colour |
linetype |
Line type |
fill |
Fill colour |
alpha |
Alpha |
xlim |
X axis limit |
ylim |
Y axis limit |
log |
log |
main |
main |
xlab |
xlab |
ylab |
ylab |
asp |
asp |
... |
Keywords passed to PDC/CDF func |
ggplot
ggdistribution(dnorm, seq(-3, 3, 0.1), mean = 0, sd = 1) ggdistribution(ppois, seq(0, 30), lambda = 20) p <- ggdistribution(pchisq, 0:20, df = 7, fill = 'blue') ggdistribution(pchisq, 0:20, p = p, df = 9, fill = 'red')
ggdistribution(dnorm, seq(-3, 3, 0.1), mean = 0, sd = 1) ggdistribution(ppois, seq(0, 30), lambda = 20) p <- ggdistribution(pchisq, 0:20, df = 7, fill = 'blue') ggdistribution(pchisq, 0:20, p = p, df = 9, fill = 'red')
Define Fortify and Autoplot to Allow 'ggplot2' to Draw Some Popular Packages
Maintainer: Yuan Tang [email protected] (ORCID)
Authors:
Masaaki Horikoshi [email protected]
Other contributors:
Austin Dickey [contributor]
Matthias GreniƩ [contributor]
Ryan Thompson [contributor]
Luciano Selzer [contributor]
Dario Strbenac [contributor]
Kirill Voronin [contributor]
Damir Pulatov [contributor]
Useful links:
stats::monthplot
Plot seasonal subseries of time series, generalization of stats::monthplot
ggfreqplot( data, freq = NULL, nrow = NULL, ncol = NULL, conf.int = FALSE, conf.int.colour = "#0000FF", conf.int.linetype = "dashed", conf.int.fill = NULL, conf.int.alpha = 0.3, conf.int.value = 0.95, facet.labeller = NULL, ... )
ggfreqplot( data, freq = NULL, nrow = NULL, ncol = NULL, conf.int = FALSE, conf.int.colour = "#0000FF", conf.int.linetype = "dashed", conf.int.fill = NULL, conf.int.alpha = 0.3, conf.int.value = 0.95, facet.labeller = NULL, ... )
data |
|
freq |
Length of frequency. If not provided, use time-series frequency |
nrow |
Number of plot rows |
ncol |
Number of plot columns |
conf.int |
Logical flag indicating whether to plot confidence intervals |
conf.int.colour |
line colour for confidence intervals |
conf.int.linetype |
line type for confidence intervals |
conf.int.fill |
fill colour for confidence intervals |
conf.int.alpha |
alpha for confidence intervals |
conf.int.value |
Coverage probability for confidence interval |
facet.labeller |
A vector used as facet labels |
... |
Keywords passed to autoplot.ts |
ggplot
## Not run: ggfreqplot(AirPassengers) ggfreqplot(AirPassengers, freq = 4) ggfreqplot(AirPassengers, conf.int = TRUE) ## End(Not run)
## Not run: ggfreqplot(AirPassengers) ggfreqplot(AirPassengers, freq = 4) ggfreqplot(AirPassengers, conf.int = TRUE) ## End(Not run)
ggplot2::ggplot
instancesAn S4 class to hold multiple ggplot2::ggplot
instances
## S4 method for signature 'ggmultiplot' length(x) ## S4 method for signature 'ggmultiplot,ANY,ANY,ANY' x[i, j, ..., drop = TRUE] ## S4 method for signature 'ggmultiplot' x[[i, j, ..., drop]] ## S4 replacement method for signature 'ggmultiplot,ANY,ANY,ANY' x[i, j, ...] <- value ## S4 replacement method for signature 'ggmultiplot' x[[i, j, ...]] <- value
## S4 method for signature 'ggmultiplot' length(x) ## S4 method for signature 'ggmultiplot,ANY,ANY,ANY' x[i, j, ..., drop = TRUE] ## S4 method for signature 'ggmultiplot' x[[i, j, ..., drop]] ## S4 replacement method for signature 'ggmultiplot,ANY,ANY,ANY' x[i, j, ...] <- value ## S4 replacement method for signature 'ggmultiplot' x[[i, j, ...]] <- value
x |
|
i |
elements to extract or replace |
j |
not used |
... |
not used |
drop |
not used |
value |
value to be set |
plots
List of ggplot2::ggplot
instances
ncol
Number of grid columns
nrow
Number of grid rows
Plots time-series diagnostics
ggtsdiag( object, gof.lag = 10, conf.int = TRUE, conf.int.colour = "#0000FF", conf.int.linetype = "dashed", conf.int.fill = NULL, conf.int.alpha = 0.3, ad.colour = "#888888", ad.linetype = "dashed", ad.size = 0.2, nrow = NULL, ncol = 1, ... )
ggtsdiag( object, gof.lag = 10, conf.int = TRUE, conf.int.colour = "#0000FF", conf.int.linetype = "dashed", conf.int.fill = NULL, conf.int.alpha = 0.3, ad.colour = "#888888", ad.linetype = "dashed", ad.size = 0.2, nrow = NULL, ncol = 1, ... )
object |
A fitted time-series model |
gof.lag |
The maximum number of lags for a Portmanteau goodness-of-fit test |
conf.int |
Logical flag indicating whether to plot confidence intervals |
conf.int.colour |
line colour for confidence intervals |
conf.int.linetype |
line type for confidence intervals |
conf.int.fill |
fill colour for confidence intervals |
conf.int.alpha |
alpha for confidence intervals |
ad.colour |
Line colour for additional lines |
ad.linetype |
Line type for additional lines |
ad.size |
Fill colour for additional lines |
nrow |
Number of facet/subplot rows |
ncol |
Number of facet/subplot columns |
... |
other keywords |
ggplot
## Not run: ggtsdiag(arima(AirPassengers)) ## End(Not run)
## Not run: ggtsdiag(arima(AirPassengers)) ## End(Not run)
The implemented grid.draw method for ggmultiplot, in order to work with ggsave() properly
## S3 method for class 'ggmultiplot' grid.draw(x, recording = TRUE)
## S3 method for class 'ggmultiplot' grid.draw(x, recording = TRUE)
x |
|
recording |
|
Infer class name
infer(data)
infer(data)
data |
list instance |
character
data.frame
fortified from target.Check object is target class, or object is data.frame
fortified from target.
is_derived_from(object, target)
is_derived_from(object, target)
object |
instance to be checked. For data.frame, check whether it is fortified from target class |
target |
class name |
logical
ggfortify:::is_derived_from(prcomp(iris[-5]), 'prcomp')
ggfortify:::is_derived_from(prcomp(iris[-5]), 'prcomp')
ts
variatesCheck if Validates number of ts
variates
is.univariate(data, raise = TRUE)
is.univariate(data, raise = TRUE)
data |
|
raise |
Logical flag whether raise an error |
logical
## Not run: ggfortify:::is.univariate(AirPassengers) ## End(Not run)
## Not run: ggfortify:::is.univariate(AirPassengers) ## End(Not run)
ggplot2::ggplot
Attach confidence interval to ggplot2::ggplot
plot_confint( p, data = NULL, lower = "lower", upper = "upper", conf.int = TRUE, conf.int.geom = "line", conf.int.group = NULL, conf.int.colour = "#0000FF", conf.int.linetype = "none", conf.int.fill = "#000000", conf.int.alpha = 0.3 )
plot_confint( p, data = NULL, lower = "lower", upper = "upper", conf.int = TRUE, conf.int.geom = "line", conf.int.group = NULL, conf.int.colour = "#0000FF", conf.int.linetype = "none", conf.int.fill = "#000000", conf.int.alpha = 0.3 )
p |
|
data |
data contains lower and upper confidence intervals |
lower |
column name for lower confidence interval |
upper |
column name for upper confidence interval |
conf.int |
Logical flag indicating whether to plot confidence intervals |
conf.int.geom |
geometric string for confidence interval. 'line' or 'step' |
conf.int.group |
name of grouping variable for confidence intervals |
conf.int.colour |
line colour for confidence intervals |
conf.int.linetype |
line type for confidence intervals |
conf.int.fill |
fill colour for confidence intervals |
conf.int.alpha |
alpha for confidence intervals |
ggplot
d <- fortify(stats::acf(AirPassengers, plot = FALSE)) p <- ggplot(data = d, mapping = aes(x = Lag)) ggfortify:::plot_confint(p, data = d)
d <- fortify(stats::acf(AirPassengers, plot = FALSE)) p <- ggplot(data = d, mapping = aes(x = Lag)) ggfortify:::plot_confint(p, data = d)
ggplot2::ggplot
Attach label to ggplot2::ggplot
plot_label( p, data, x = NULL, y = NULL, label = TRUE, label.label = "rownames", label.colour = NULL, label.alpha = NULL, label.size = NULL, label.angle = NULL, label.family = NULL, label.fontface = NULL, label.lineheight = NULL, label.hjust = NULL, label.vjust = NULL, label.repel = FALSE, label.show.legend = NA, label.position = "identity" )
plot_label( p, data, x = NULL, y = NULL, label = TRUE, label.label = "rownames", label.colour = NULL, label.alpha = NULL, label.size = NULL, label.angle = NULL, label.family = NULL, label.fontface = NULL, label.lineheight = NULL, label.hjust = NULL, label.vjust = NULL, label.repel = FALSE, label.show.legend = NA, label.position = "identity" )
p |
|
data |
Data contains text label |
x |
x coordinates for label |
y |
y coordinates for label |
label |
Logical value whether to display labels |
label.label |
Column name used for label text |
label.colour |
Colour for text labels |
label.alpha |
Alpha for text labels |
label.size |
Size for text labels |
label.angle |
Angle for text labels |
label.family |
Font family for text labels |
label.fontface |
Fontface for text labels |
label.lineheight |
Lineheight for text labels |
label.hjust |
Horizontal adjustment for text labels |
label.vjust |
Vertical adjustment for text labels |
label.repel |
Logical flag indicating whether to use |
label.show.legend |
Logical value indicating whether to show the legend of the text labels |
label.position |
Character or a position function |
ggplot
ggplot2::qplot
Post process for fortify. Based on ggplot2::qplot
post_autoplot( p, xlim = c(NA, NA), ylim = c(NA, NA), log = "", main = NULL, xlab = NULL, ylab = NULL, asp = NULL )
post_autoplot( p, xlim = c(NA, NA), ylim = c(NA, NA), log = "", main = NULL, xlab = NULL, ylab = NULL, asp = NULL )
p |
|
xlim |
limits for x axis |
ylim |
limits for y axis |
log |
which variables to log transform ("x", "y", or "xy") |
main |
character vector or expression for plot title |
xlab |
character vector or expression for x axis label |
ylab |
character vector or expression for y axis label |
asp |
the y/x aspect ratio |
data.frame
p <- qplot(Petal.Length, Petal.Width, data = iris) ggfortify:::post_autoplot(p, xlim = c(1, 5), ylim = c(1, 5), log = 'xy', main = 'title', xlab = 'x', ylab = 'y', asp = 1.5)
p <- qplot(Petal.Length, Petal.Width, data = iris) ggfortify:::post_autoplot(p, xlim = c(1, 5), ylim = c(1, 5), log = 'xy', main = 'title', xlab = 'x', ylab = 'y', asp = 1.5)
Post process for fortify.
post_fortify(data, klass = NULL)
post_fortify(data, klass = NULL)
data |
data.frame |
klass |
instance to be added as base_class attr, should be original model before fortified |
data.frame
ggmultiplot
Generic print function for ggmultiplot
## S4 method for signature 'ggmultiplot' print(x)
## S4 method for signature 'ggmultiplot' print(x)
x |
|
data.frame
Rbind original and predicted time-series-like instances as fortified data.frame
rbind_ts( data, original, ts.connect = TRUE, index.name = "Index", data.name = "Data" )
rbind_ts( data, original, ts.connect = TRUE, index.name = "Index", data.name = "Data" )
data |
Predicted/forecasted |
original |
Original |
ts.connect |
Logical frag indicates whether connects original time-series and predicted values |
index.name |
Specify column name for time series index |
data.name |
Specify column name for univariate time series data. Ignored in multivariate time series. |
data.frame
## Not run: predicted <- predict(stats::HoltWinters(UKgas), n.ahead = 5, prediction.interval = TRUE) rbind_ts(predicted, UKgas, ts.connect = TRUE) ## End(Not run)
## Not run: predicted <- predict(stats::HoltWinters(UKgas), n.ahead = 5, prediction.interval = TRUE) rbind_ts(predicted, UKgas, ts.connect = TRUE) ## End(Not run)
stats::ar
Calculate residuals for stats::ar
## S3 method for class 'ar' residuals(object, ...)
## S3 method for class 'ar' residuals(object, ...)
object |
|
... |
other keywords |
ts Residuals extracted from the object object.
## Not run: residuals(ar(WWWusage)) ## End(Not run)
## Not run: residuals(ar(WWWusage)) ## End(Not run)
ggmultiplot
Generic show function for ggmultiplot
## S4 method for signature 'ggmultiplot' show(object)
## S4 method for signature 'ggmultiplot' show(object)
object |
|
ggplot2::autoplot
Check if passed object is supported by ggplot2::autoplot
support_autoplot(obj)
support_autoplot(obj)
obj |
object |
logical
scale
-ed objectBacktransform scale
-ed object
unscale(data, center = NULL, scale = NULL)
unscale(data, center = NULL, scale = NULL)
data |
Scaled data |
center |
Centered vector |
scale |
Scale vector |
data.frame
df <- iris[-5] ggfortify::unscale(base::scale(df))
df <- iris[-5] ggfortify::unscale(base::scale(df))