Learn R Programming

fmx (version 0.1.2)

as.fmx.mixEM: Convert mixEM Objects to fmx Class

Description

To convert mixEM objects (from package mixtools) to fmx class.

Currently only the returned value of normalmixEM and gammamixEM are supported

Usage

# S3 method for mixEM
as.fmx(x, data = x[["x"]], ...)

Value

Function as.fmx.mixEM returns an fmx object.

Arguments

x

mixEM object

data

numeric vector

...

..

Examples

Run this code
library(mixtools)
(wait = as.fmx(normalmixEM(faithful$waiting, k = 2)))
hist.default(faithful$waiting, freq = FALSE)
curve(dfmx(x, dist = wait), xlim = range(faithful$waiting), add = TRUE)

Run the code above in your browser using DataLab