Learn R Programming

mldr (version 0.3.22)

plot.mldr: Generates graphic representations of an mldr object

Description

Generates graphic representations of an mldr object

Usage

"plot"(x, type = "LC", labelCount, labelIndices, title, ask = length(type) > prod(par("mfcol")), ...)

Arguments

x
The mldr object whose features are to be drawn
type
Indicates the type(s) of plot to be produced. Possible types are:
  • "LC" Draws a circular plot with sectors representing each label and links between them depicting label co-occurrences
  • "LH" for label histogram
  • "LB" for label bar plot
  • "CH" for cardinality histogram
  • "AT" for attributes by type pie chart
  • "LSH" for labelset histogram
  • "LSB" for labelset bar plot
labelCount
Samples the labels in the dataset to show information of only labelCount of them
labelIndices
Establishes the labels to be shown in the plot
title
A title to be shown above the plot. Defaults to the name of the dataset passed as first argument
ask
Specifies whether to pause the generation of plots after each one
...
Additional parameters to be given to barplot, hist, etc.

Examples

Run this code

library(mldr)
## Not run: 
# # Label concurrence plot
# plot(genbase, type = "LC") # Plots all labels
# plot(genbase) # Same as above
# plot(genbase, title = "genbase dataset", color.function = heat.colors) # Changes the title and color
# plot(genbase, labelCount = 10) # Randomly selects 10 labels to plot
# plot(genbase, labelIndices = genbase$labels$index[1:10]) # Plots info of first 10 labels
# 
# # Label bar plot
# plot(emotions, type = "LB", col = terrain.colors(emotions$measures$num.labels))
# 
# # Label histogram plot
# plot(emotions, type = "LH")
# 
# # Cardinality histogram plot
# plot(emotions, type = "CH")
# 
# # Attributes by type
# plot(emotions, type = "AT", cex = 0.85)
# 
# # Labelset histogram
# plot(emotions, type = "LSH")
# ## End(Not run)

Run the code above in your browser using DataLab