Introduction to Arena2R"

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

Exporting Arena Report Database

This is a basic example which shows you how to get your Arena results quickly into R. The basic idea is to run different scenarios and save each of them to a separate csv file. (Yes, you could use Process Analyzer (PAN) to run all scenarios, but to my knowledge, there's no way to get your data out of the PAN easily).

Follow these steps to get Arena simulation results to R:

Using the Shiny App

If you're not familiar to R, you can run this command on R Console and use the example app.

runArenaApp()

After running this command, the app screen will pop up. You can upload your csv files and play around with the Confidence Interval and Scatter Plots.

Using the Package with an R Script

# Load the library:

library(arena2r)

# Define the path to your folder with Arena csv files. In my case, it's here:

my_path = system.file("extdata", package = "arena2r")

# Then, get a tidy results data.frame out of your files!
results = arena2r::get_simulation_results(my_path)

You can also play around with the arena_results dataset included in the package. To use it, follow these steps:

library(arena2r)

# Load the example dataset:
data("arena_results")

# Let's call it results
results = arena_results

knitr::kable(head(results))

After these steps, now you have a tidy data.frame with your results. Let's get into possible visualizations. Usually, you'll be interested in the mean confidence interval for some response variable, across scenarios.

# Plot a Statistic confidence interval across scenarios for a response variable.

arena2r::plot_confint(sim_results = results, response_variable = "Entity 1.NumberOut")

Now let's explore the relationship between two variables, across scenarios and replications:

# Now let's plot analyse the relationship between two variables:

arena2r::plot_scatter(sim_results = results, x_variable = "Entity 1.NumberIn", y_variable = "Entity 1.NumberOut")

Finally, let's summarise every statistic across all scenarios.

statistics_summary = arena2r::get_statistics_summary(sim_results = results, confidence = 0.95)

knitr::kable(head(statistics_summary[,1:6]))

I hope you enjoyed the package.



Try the arena2r package in your browser

Any scripts or data that you put into this service are public.

arena2r documentation built on May 2, 2019, 3:47 p.m.