Learn R Programming

rmoo (version 0.2.0)

plot: Methods for Function 'plot' in Package 'rmoo'

Description

Method used to visualize the fitness of the individuals during the execution of the algorithms.

Usage

plot(x, y, ...)

# S4 method for nsga,missing plot(x, y = "missing", type = c("scatter", "pcp", "heatmap", "polar"), ...)

# S4 method for nsga1,missing plot(x, y = "missing", type = c("scatter", "pcp", "heatmap", "polar"), ...)

# S4 method for nsga2,missing plot(x, y = "missing", type = c("scatter", "pcp", "heatmap", "polar"), ...)

# S4 method for nsga3,missing plot(x, y = "missing", type = c("scatter", "pcp", "heatmap", "polar"), ...)

Value

A graph of the evaluated type.

Arguments

x, y

Objects of either class nsga1, nsga2, or nsga3.

...

other arguments passed on to methods

"optimal"

An argument passed to the "scatter" plot. A matrix of dimension equal to the fitness with which they are compared. This value can only be compared in 2 and 3 dimensional "scatter" plots.

"individual"

An argument passed to the "heatmap" and "polar" plots. A vector that represents the fitness of the individuals to be displayed.

type

Type of graph to draw, the graphs can be of the type "scatter", "pcp", "heatmap", or "polar"

Author

Francisco Benitez benitezfj94@gmail.com

Details

The following plots are available:

  • "Scatter Plot"

  • "Parallel Coordinate Plot"

  • "Heat Map"

  • "Polar Coordinate"

Examples

Run this code
# Where 'out' is an object of class nsga1, nsga2, or nsga3.
# The plot method will by default plot a scatter plot.
#
# plot(out)
#
# The Parallel Coordinate Plot will be plotted if "pcp" is passed as a parameter to "type".
#
# plot(out, type="pcp")
#
# A heat map plot will be plotted if "heatmap" is passed as a parameter to "type"
# and a vector with the individuals to plot to "individual"
#
# plot(out, type = "heatmap", individual = c(1:5))
#
# A polar coordinate plot will be plotted if "polar" is passed as a parameter to "type"
# and a vector with the individuals to plot to "individual"
#
# plot(out, type = "polar", individual = c(1:5))

Run the code above in your browser using DataLab