Errors in running code in vignettes:
when running code in 'PRROC.Rnw'

> library(PRROC)

> set.seed(127)

> fg <- rnorm(300)

> bg <- rnorm(500, -2)

> roc <- roc.curve(scores.class0 = fg, scores.class1 = bg)

> pr <- pr.curve(scores.class0 = fg, scores.class1 = bg)

> roc

  ROC curve

    Area under curve:
     0.9162667 

    Curve not computed ( can be done by using curve=TRUE )

> pr

  Precision-recall curve

    Area under curve (Integral):
     0.8777665 

    Area under curve (Davis & Goadrich):
     0.8777661 

    Curve not computed ( can be done by using curve=TRUE )

> roc <- roc.curve(scores.class0 = fg, scores.class1 = bg, 
+     curve = TRUE)

> pr <- pr.curve(scores.class0 = fg, scores.class1 = bg, 
+     curve = TRUE)

> roc

  ROC curve

    Area under curve:
     0.9162667 

    Curve for scores from  -4.935784  to  2.888259 
    ( can be plotted with plot(x) )


> pr

  Precision-recall curve

    Area under curve (Integral):
     0.8777665 

    Area under curve (Davis & Goadrich):
     0.8777661 

    Curve for scores from  -4.935784  to  2.888259 
    ( can be plotted with plot(x) )


> plot(roc)

> plot(roc)

> plot(pr)

> plot(pr)

> x <- c(fg, bg)

> lab <- c(rep(1, length(fg)), rep(0, length(bg)))

> roc <- roc.curve(scores.class0 = x, weights.class0 = lab)

> pr <- pr.curve(scores.class0 = x, weights.class0 = lab)

> roc

  ROC curve

    Area under curve:
     0.9162667 

    Curve not computed ( can be done by using curve=TRUE )

> pr

  Precision-recall curve

    Area under curve (Integral):
     0.8777665 

    Area under curve (Davis & Goadrich):
     0.8777661 

    Curve not computed ( can be done by using curve=TRUE )

> wfg <- c(runif(300, min = 0.5, max = 1), runif(500, 
+     min = 0, max = 0.5))

> hist(wfg[301:800], col = 2, xlim = c(0, 1), main = "Weights", 
+     xlab = "foreground weight")

> hist(wfg[1:300], col = 3, add = T)

> wroc <- roc.curve(scores.class0 = x, weights.class0 = wfg, 
+     curve = TRUE)

> wpr <- pr.curve(scores.class0 = x, weights.class0 = wfg, 
+     curve = TRUE)

> wroc <- roc.curve(scores.class0 = x, scores.class1 = x, 
+     weights.class0 = wfg, weights.class1 = 1 - wfg, curve = TRUE)

> wpr <- pr.curve(scores.class0 = x, scores.class1 = x, 
+     weights.class0 = wfg, weights.class1 = 1 - wfg, curve = TRUE)

> plot(wroc)

> plot(wroc)

> plot(wpr)

> plot(wpr)

> wpr <- pr.curve(scores.class0 = x, weights.class0 = wfg, 
+     curve = TRUE, max.compute = T, min.compute = T, rand.compute = T)

> wroc <- roc.curve(scores.class0 = x, weights.class0 = wfg, 
+     curve = TRUE, max.compute = T, min.compute = T, rand.compute = T)

> wpr

  Precision-recall curve

    Area under curve (Integral):
     0.6374131 

    Relative area under curve (Integral):
     0.6832175 

    Area under curve (Davis & Goadrich):
    cannot be computed for weighted data

    Curve for scores from  -4.935784  to  2.888259 
    ( can be plotted with plot(x) )



    Maximum AUC:
     0.7987053   NA 


    Minimum AUC:
     0.2895479   NA 


    AUC of a random classifier:
     0.4431009   0.4431009 

> wroc

  ROC curve

    Area under curve:
     0.6946752 

    Relative area under curve:
     0.8007416 

    Curve for scores from  -4.935784  to  2.888259 
    ( can be plotted with plot(x) )



    Maximum AUC:
     0.8236585 


    Minimum AUC:
     0.1763415 


    AUC of a random classifier:
     0.5 

> plot(wpr, max.plot = TRUE, min.plot = TRUE, rand.plot = TRUE, 
+     fill.area = TRUE)

> plot(wpr, max.plot = TRUE, min.plot = TRUE, rand.plot = TRUE, 
+     fill.area = TRUE)

> y <- c(rnorm(300, sd = 2), rnorm(500, -5, sd = 2))

> wpr2 <- pr.curve(scores.class0 = y, weights.class0 = wfg, 
+     curve = TRUE, max.compute = TRUE, min.compute = TRUE, rand.compute = TRUE)

> wroc2 <- roc.curve(scores.class0 = y, weights.class0 = wfg, 
+     curve = TRUE, max.compute = TRUE, min.compute = TRUE, rand.compute = TRUE)

> plot(wpr, max.plot = TRUE, min.plot = TRUE, rand.plot = TRUE, 
+     fill.area = T, color = 2, auc.main = FALSE)

> plot(wpr2, add = TRUE, color = 3)

> plot(wpr, max.plot = TRUE, min.plot = TRUE, rand.plot = TRUE, 
+     fill.area = T, color = 2, auc.main = FALSE)

> plot(wpr2, add = TRUE, color = 3)

> plot(wpr, scale.color = heat.colors(100))

> plot(wpr, scale.color = heat.colors(100))

> plot(wpr, auc.main = FALSE, main = "My classifier")

> plot(wpr, auc.main = FALSE, main = "My classifier")

> plot(wpr, legend = FALSE)

> plot(wpr, legend = FALSE)

> plot(wpr, color = 3, lty = "dotted")

> plot(wpr, color = 3, lty = "dotted")

> plot(wpr, legend = 1)

> plot(wpr, legend = 1)

> plot(wpr, rand.plot = TRUE, fill.area = TRUE, fill.color = rgb(0.8, 
+     1, 0.8), maxminrand.col = "blue")

> plot(wpr, rand.plot = TRUE, fill.area = TRUE, fill.color = rgb(0.8, 
+     1, 0.8), maxminrand.col = "blue")

> curve.points <- wpr$curve

> curve.points[1:5, ]
          [,1]      [,2]      [,3]
[1,] 1.0000000 0.4431009 -4.935784
[2,] 1.0000000 0.4431009 -4.935784
[3,] 0.9987774 0.4431131 -4.766034
[4,] 0.9982695 0.4434427 -4.693354
[5,] 0.9970938 0.4434762 -4.625728

> plot(curve.points[, 1], curve.points[, 2], xlab = "Recall", 
+     ylab = "Precision", t = "l")

> plot(curve.points[, 1], curve.points[, 2], xlab = "Recall", 
+     ylab = "Precision", t = "l")

> library(ggplot2)

  When sourcing 'PRROC.R':
Error: there is no package called 'ggplot2'
Execution halted

  'PRROC.Rnw'... failed