I'm planning to use patchwork to assemble several ROC curves plotted with pROC. After constructing a pROC plot list (of S3: roc objects) and attempting to use wrap_plots(plots) to assemble, I came across the following error:
Error: Only know how to add ggplots and/or grobs
AFAIK, there may be several solutions:
- Coerce S3:roc objects to ggplots. It seems the function
fortifydoes this job for S3 objects generated byprecrecpackage but I don't know if S3:roc objects can be done in the same way. Usingggplot2::fortifyI ran into
`data` must be a data frame, or other object coercible by `fortify()`, not an S3 object with class roc.
- Use
precrecto streamline the conversion, instead. What curtails my migration is that I want to print Youden index point and confidence intervals of the Youden index point and area under curve (AUC) on the plot. It seems onlypROCpackage meets all my needs so I don't quite want to move on. Also I need to adjust my codes to cater parameter demands fromprecrec. Too much to learn and try, so tutorials and simple codes are appreciated.
Whatever, my final purpose is being able to assemble all ROC curves programmatically, with automatic annotations. The ROC curves need to show their respective Youden index point and confidence intervals of the Youden index point and area under curve (AUC) on the plot.
Drawbacks exist in the pROC package, too. The text sizes of Youden index and confidence interval values are too small for the whole plot if all ROC plots are assembled. I can adjust them by specifying par(cex=<text size>) but there's ricks that the texts may overlap with the curves or get out of bound if the texts are too marginal. pROC is not smart enough to reconcile with text sizes, curves and text positions. A smarter package to meet all of my harsh demands mentioned above will strongly push me forward to adopt a new package to draw ROC curves. Therefore, solutions vary in my scenario (but please don't recommend using a graphical vector image editor to edit these curves by hand because it's time-consuming and error-prone, and lags changing demands from different journals). All insights from all perspectives are appreciated.