Skip to contents

autoplot() methods for the results of dmai; plot() draws the same figures.

Usage

autoplot.dmai_result(object, which = NULL, ...)

Arguments

object

a result of dmai(..., as_dt = FALSE), dmai_compare(), dmai_user_cost() or dmai_moments().

which

the figure: for dmai() results "index" (default, with the simple sum), "growth", "shares", "user_cost", "moments" or "price"; for dmai_compare() "index" or "growth"; for dmai_user_cost() "shares" or "user_cost".

...

not used.

Value

A ggplot object.

Author

Muhammad Yaseen (myaseen208@gmail.com)

Examples

data(money_sim)
fit <-
  dmai(
      .data     = money_sim
    , method    = "Barnett"
    , logbase   = NULL
    , date      = "Date"
    , x         = NULL
    , r         = NULL
    , user_cost = NULL
    , benchmark = "rb"
    , percent   = TRUE
    , base      = 100
    , as_dt     = FALSE
    )
ggplot2::autoplot(
    object = fit
  , which  = "shares"
  )