geom_cobweb: Cobweb plot

Description Usage Arguments Aesthetics Examples

Description

The cobweb geom is an addition to the ggplot2 package for plotting cobweb or spider plots.

Usage

1
2
3
4
5
6
7
geom_cobweb(mapping = NULL, data = NULL, stat = "identity",
  position = "identity", na.rm = FALSE, show.legend = TRUE,
  theme = list(panel.background = element_rect(fill = "white", colour =
  "white")), grid_lty = "dashed", grid_lwd = 1, grid_alpha = 0.75,
  grid_fontsize = 12, grid_Nticks = 4, grid_ticks = NULL,
  grid_labels = NULL, grid_label_position = 1,
  grid_label_hjust = 0.5, grid_label_vjust = -0.5, ...)

Arguments

mapping

(from ggplot call) A mapping of ggplot variables. geom_cobweb expects an AUCs variable.

data

(from ggplot call) The data frame supplied to the

stat

(from ggplot call) ggplot identity stat.

position

(from ggplot call) ggplot identity position.

na.rm

(from ggplot call) remove NAs, default is FALSE.

show.legend

Whether to show the legend. Default is TRUE.

theme

Default theme settings for correct visualization.

grid_lty

The linetype of the background grid. Deafult is 'dashed'.

grid_lwd

The linewidth of the background grid. Deafult is 1.

grid_alpha

The alpha of the background grid. Deafult is 0.75.

grid_fontsize

The fontsize of the grid labels. Deafult is 12.

grid_Nticks

The number of gridlines (makes use of pretty so number is not a hard threshold). Default is 4.

grid_ticks

vector with values of gridlines to be drawn (unlike grid_Nticks, this is exact).

grid_labels

The labels to use for the gridlines.

grid_label_position

The position alonng the cobweb where to plot the grid labels. (numeric value)

grid_label_hjust

The hjust of grid_labels

grid_label_vjust

The vjust of grid_labels

...

Extra aesthetics parameters, see Aesthetics section.

Aesthetics

geom_cobweb understands the following aesthetics (required aesthetics are in bold):

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
library(ggplot2)
n_comparison <- 3
AUC.df <- data.frame(type = c(rep("ROC",6),rep("Random",6)),  
                    AUCs = c(0.34, 1.00, 0.56, 0.40, 0.37, 0.45, rep(1/n_comparison, 6)))

ggplot(AUC.df, aes(AUCs = AUCs,  colour = type)) + 
    geom_cobweb() + 
    theme_cobweb() +
    ggtitle("Testen") +
    coord_equal()
 
 
 
ggplot(AUC.df, aes(AUCs = AUCs,  colour = type)) + 
    geom_cobweb(grid_Nticks = 2,
                show.legend = TRUE,
                grid_label_position = 2) + 
    theme_cobweb() +
    ggtitle("Testen") +
    coord_equal()
 

Beirnaert/MetaboMeeseeks documentation built on May 20, 2019, 11:09 a.m.