Description Usage Arguments Value Examples
Plot the Empirical Cumulative Distribution Functions (ECDFs) for a couple of different datasets.
1 2 3 4 5 6 7 8 | ## S3 method for class 'func.ecdf'
plot(x, goal = 0, goal.dim = 2L, time.dim = 1L,
time.type = as.integer, time.min = time.type(1L),
time.max = time.type(NA_real_), goal.min = 0, goal.max = 1,
extract.runs = identity, comparator = `<=`, extract.run = identity,
lineTypeFun = lineTypes.distinct, colorFun = colors.distinct,
goal.markers = c(0.2, 0.4, 0.6, 0.8), time.markers = NULL,
legend = NULL, legend.pos = "topleft", legend.cex = NA, ...)
|
x |
the data, maybe a list of [lists of matrices or a list of
vectors/lists], where each element has at least the |
goal |
the goal value, i.e., the value which must be reached to be counted as success |
goal.dim |
the dimension where where the goal values can be found |
time.dim |
the dimension where the time values can be found |
time.type |
the type function the time dimension, should be
|
time.min |
the minimum time value to be used for the diagram, or
|
time.max |
the maximum time value to be used, or |
goal.min |
the minimum goal value |
goal.max |
the maximum goal value |
extract.runs |
a function which can be used to extract the run sets from
|
comparator |
the comparator, usually |
extract.run |
a function which can be used to extract the single runs
from the run sets, e.g., |
lineTypeFun |
the line type function, a function returning the line types to use for a provided number of inputs |
colorFun |
the colors function, a function returning the color list to use for a provided number of inputs |
goal.markers |
markers for the goal values |
time.markers |
markers for the time values |
legend |
the legend names |
legend.pos |
the legend position (optional, default: topleft) |
legend.cex |
the character sizing for the legend, optional, default
|
... |
Arguments passed on to
|
a list(x=c(time.min, time.max), y=c(goal.min, goal.max))
of
the minimum and maximum time and goal values encountered
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | library("plotteR");
set.seed(10000L);
time.max.pow <- 8;
# create a single run, where the quality dimension reaches to end
make.run <- function(end) {
repeat {
x <- sort(unique(as.integer(runif(n=20L, min=1L,
max=(10^(runif(n=1L, min=2, max=time.max.pow)))))));
if(length(x) == 20L) { break; }
}
repeat {
y <- sort(unique(c(end, runif(n=19L, min=end, max=500))), decreasing=TRUE);
if(length(y) == 20L) {
break;
}
}
return(matrix(c(x, y), ncol=2L))
}
# make n runs where m reach below 0, i.e., whose ECDF reaches m/n
make.runs <- function(n, m) {
return(lapply(X=seq_len(n),
FUN=function(i) {
if(i <= m) { end <- runif(n=1L, min=-10L, max=0L); }
else { end <- runif(n=1L, min=1L, max=100L); }
return(make.run(end));
}))
}
# plot five example ECDFs, where the end results reach 3/20, 10/20, 5/20, 15/20,
# and 19/20, respectively
plot.func.ecdf(x = list(make.runs(20, 3),
make.runs(20, 10),
make.runs(20, 5),
make.runs(20, 15),
make.runs(20, 19)),
legend=c("worst", "good", "bad", "better", "best"),
time.markers=c(1e2, 1e4, 1e6, 1e8),
log="x",
time.max=(10^time.max.pow));
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.