avg.plot | R Documentation |

Calculates the average simulated values of all parameters and generates plots.

avg.plot( data.mat, start, end, x.lab = "Iteration number", y.lab = "Average of simulated values", title = NULL, details = FALSE )

`data.mat` |
data matrix including the simulated values for plot. |

`start` |
the number of cycle to start. |

`end` |
the number of cycle to end. |

`x.lab` |
label of the x axis in the generated plot, default is set to "Iteration number". |

`y.lab` |
label of the y axis in the generated plot, default is set to "Average of simulated values". |

`title` |
title of each generated plot. |

`details` |
logical variable to specify whether the average simulated values are returned, default is set to FALSE. |

This function calculates the average simulated values across simulations.
`iter`

can be any number of iterations you want to draw, the corresponding number of rows
of the data should be `iter`

+ 1.

The plot of averaged values across iterations. If `details`

= TRUE,
a matrix containing the averaged values of all the variables across iterations will be returned.

### generate some normal data dat <- MASS::mvrnorm(n = 1000, mu = c(1, 2, 3, 4), Sigma = diag(4)) ### set column names colnames(dat) <- paste0("Var ", 1:ncol(dat)) ### average values plot: take sample from 500 to 1000 rows avg.plot(data.mat = dat[500:1000, ], start = 500, end = 1000, title = "Random Variables")

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.