fortify.MSM.lm: Convert 'MSwM::MSM.lm' to 'data.frame'

Description Usage Arguments Value Examples

View source: R/fortify_MSwM.R

Description

Convert MSwM::MSM.lm to data.frame

Usage

1
2
## S3 method for class 'MSM.lm'
fortify(model, data = NULL, melt = FALSE, ...)

Arguments

model

MSwM::MSM.lm instance

data

original dataset, if needed

melt

Logical flag indicating whether to melt each models

...

other arguments passed to methods

Value

data.frame

Examples

1
2
3
4
5
6
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)

ggfortify documentation built on May 26, 2018, 5:04 p.m.