Description Usage Arguments Value Examples

View source: R/ggplotObjectiveSpace.R

Use the coloring of the cumulated path lengths (see
`computeCumulatedPathLengths`

) and visualize the
corresponding points in the objective space.

1 2 3 |

`df` |
[ |

`var1` |
[ |

`var2` |
[ |

`log.scale` |
[ |

`impute.zero` |
[ |

`minimalistic.image` |
[ |

`color.palette` |
[ |

`legend.position` |
[ |

`...` |
[any] |

[`ggplot`

]

A `ggplot`

object displaying the multi-objective gradient landscape.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ```
# Define two single-objective test problems and a grid of points:
fn1 = function(x) sum((x - c(0.2, 1))^2)
fn2 = function(x) sum((x - c(0.5, 0.5))^2)
points = as.matrix(expand.grid(x1 = seq(0, 0.7, 0.01), x2 = seq(0, 1.25, 0.01)))
# Compute the corresponding gradients and the cumulated path lengths:
gradients = computeGradientField(points, fn1, fn2)
x = computeCumulatedPathLengths(points, gradients)
# Next, compute the image of the grid points in the objective space:
obj.space = apply(points, 1, function(x) c(y1 = fn1(x), y2 = fn2(x)))
obj.space = as.data.frame(t(obj.space))
# Append the cumulated path lengths:
obj.space$height = x$height
# Finally, visualize the resulting objective space:
ggplotObjectiveSpace(obj.space)
``` |

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.