dmvfplot: Draw a graph of diff of mean value functions on discrete time...

Description Usage Arguments Details Value Examples

View source: R/plot.R

Description

This function draws a graph of mean value function with data and NHPP classes.

Usage

1
2
3
4
dmvfplot(time = NULL, fault = NULL, type = NULL, te = NULL,
  data = data.frame(), dmvf = list(), xlab = "time",
  ylab = "# of faults", datalab = "data", xmax = NA, ymax = NA,
  colors = mmcolors, ...)

Arguments

time

A numeric vector for time intervals.

fault

An integer vector for the number of faults detected in time intervals. The fault detected just at the end of time interal is not counted.

type

Either 0 or 1. If 1, a fault is detected just at the end of corresponding time interval. This is used to represent the fault time data. If 0, no fault is detected at the end of interval.

te

A numeric value for the time interval from the last fault to the observation time.

data

A dataframe. The arguments; time, fault, type, te can also be selected as the columns of dataframe.

dmvf

A list of NHPP classes. See details.

xlab

A character string, indicating the label of x-axis.

ylab

A character string, indicating the label of y-axis.

datalab

A character string, indicating the label of data in legend.

xmax

A numeric value, indicating the maximum value of xlim. If NA, the maximum value is automatically determined.

ymax

A numeric value, indicating the maximum value of ylim. If NA, the maximum value is automatically determined.

colors

A vector of strings, indicating the colors in plot.

...

Other parameters.

Details

The dmvf argument should be a list of NHPP classes. In the function, dmvf and name attributes are used. Therefore, the list with dmvf and name can be used as an element of the list of dmvf argument. The return value is an object of ggplot2, and thus a line is added like dmvfplot(...) + geom_point(stat="identity", position="identity", aes_string(x="x", y="exp", colour=shQuote("exp"))) + geom_line(stat="identity", position="identity", aes_string(x="x", y="exp", colour=shQuote("exp"))).

Value

An object of ggplot.

Examples

1
2
3
4
5
data(dmet)

result <- fit.srm.logit(fault~., data=dmet.ds1)

dmvfplot(fault=dmet.ds1$fault, dmvf=list(result$srm))

okamumu/Rsrat documentation built on April 2, 2018, 7:33 p.m.