rlistroccoords

Return all coordinates of ROC curve and save into a list


I would like to save all coordinates of a ROC curve into a list so that I can later on plot multiple ROC curves.

How do I specify my x value to return all coordinates?

roc_train <- roc(target~prob, data=ordered_test, col="#1c61b6")
coord_list <- list()
coord_list[1] <- coords(roc_train)

Solution

  • I assume you are using the pROC package. The x argument can be set to "all" as in

    coord_list[[1]] <- coords(roc_train, x = "all")
    

    This will return all coordinates of the ROC curve.