Skip to content

Tutorial: 2.1. Load Benchmark

alona-sydorova edited this page Apr 4, 2018 · 7 revisions

As stated before, there are several ways to load your data into the benchmarkVis package.

Use a csv, json or Rds file

If you have a csv/json/Rds file which is structured as stated in 1. Data Structure you can simply use following command to load your benchmark result:

csvImport("PATH.TO.CSV.File")

or

jsonImport("PATH.TO.JSON.File")

or

rdsImport("PATH.TO.RDS.File")

After the import a structure check will be run to see if everything is correct.

Use a wrapper

To import a benchmark result created with a package for which a wrapper is provided you can simply use the corresponding method. One example (in this case the microbenchmark wrapper) would be:

library(microbenchmark)
x = runif(100)
benchmark = microbenchmark(sqrt(x), x ^ 0.5)

table = useMicrobenchmarkWrapper(benchmark)

You can get a full list of all wrappers with:

listWrappers()

This will result in something like this:

"useMicrobenchmarkFileWrapper"
"useMicrobenchmarkWrapper"
"useMlrBenchmarkFileWrapper"
"useMlrBenchmarkWrapper"
"useMlrTuningFileWrapper"
"useMlrTuningWrapper"
"useRbenchmarkFileWrapper"
"useRbenchmarkWrapper"

All the *FileWrapper methods are used with an RDS file.

Also for this import strategy a structure check will be executed.

Use a R data.table

If you created your data table directly in R and already checked the structure with

checkStructure(data.table)

you are ready to go.


Next - 2.2. Create Plots

Back - 2. R Shell

Clone this wiki locally