Oli
Oli

Reputation: 1

pROC Package in R - Run without Call and Data Information in RMarkdown

Anytime you create a ROC Curve with using pROC::roc() additional Information like the code itself and AUC will be plotted in rmarkdown by default below the plot.

Does anyone know how to print the ROC-Curve without the Call and Data information?

Example

Code

roc(label, score.4ISS,
plot = TRUE,
legacy.axes = TRUE)

Thank you :)

Upvotes: 0

Views: 460

Answers (2)

Oli
Oli

Reputation: 1

The solution to my problem is to assign roc() to an object. Then it prints ROC without the additional information and without using a additional print() command.

With Information

roc(label, score.4ISS)

Without Information

my_roc <- roc(label, score.4ISS)

Upvotes: 0

Calimo
Calimo

Reputation: 7969

This is because objects are implicitly printed in R when they are not assigned to variables. This means that:

roc(label, score.4ISS, ...)

is equivalent to

print(roc(label, score.4ISS, ...))

which prints call and data information. If you assign the ROC curve to an object, it won't be printed, and you can decide what to print yourself, for instance only the AUC (or nothing at all).

my_roc <- roc(label, score.4ISS, plot = TRUE, legacy.axes = TRUE)
print(auc(my_roc))

Upvotes: 0

Related Questions