# install.packages("ROCR")
suppressPackageStartupMessages(library(ROCR))

N_neg <- 1000

Ns <- seq(50, 1000, 50)

labels <- lapply(Ns, function(N_pos) c(rep(1, N_pos), rep(0, N_neg)))
values <- lapply(Ns, function(N_pos) c(rnorm(N_pos, 1), rnorm(N_neg, 0))) 

pred <- prediction(values, labels)

perf <- performance(pred, measure = "tpr", x.measure = "fpr") 
plot(perf)

perf <- performance(pred, measure = "prec", x.measure = "rec") 
plot(perf)