Learn R Programming

exuber (version 0.2.1)

autoplot.radf: Plotting with ggplot2 and tidying with tibble radf objects

Description

autoplot.radf takes an radf object and returns a (list of ) ggplot2 objects. fortify.radf takes an radf object and converts it into a data.frame. ggarrange is a wrapper of arrangeGrob(), which can be used directly after autoplot to place grobs on a page.

Usage

# S3 method for radf
autoplot(object, cv, include = FALSE, select = NULL,
  option = c("gsadf", "sadf"), min_duration = 0, ...)

# S3 method for radf fortify(model, data, cv, include = FALSE, select = NULL, option = c("gsadf", "sadf"), ...)

ggarrange(...)

Arguments

object

An object of class radf().

cv

An object of class "cv". The output of mc_cv(), wb_cv() or sb_cv()

include

If not FALSE, plot all variables regardless of rejecting the NULL at the 5% significance level.

select

If not NULL, only plot with names or column number matching this regular expression will be executed.

option

Whether to apply the "gsadf" or "sadf" methodology. Default is "gsadf".

min_duration

The minimum duration of an explosive period for it to be reported. Default is 0.

...

further arguments passed to method, ignored.

model

An object of class radf().

data

original dataset, not used (required by generic fortify() method).

Examples

Run this code
# NOT RUN {
dta <- cbind(sim_dgp1(n = 100), sim_dgp2(n = 100))

dta %>%
  radf() %>%
  autoplot() %>%
  ggarrange(ncol = 2)

# For custom plotting with ggplot2
dta %>%
  radf() %>%
  fortify()
# }

Run the code above in your browser using DataLab