I made a graph of Kaplan Meier curves for a pesticide bioassay of 4 concentrations (negative control, 1/10000 field rate, 1/100 field rate and field rate), which was recorded in the data frame as 0, 0.0001, 0.01 and 1. I expected the legend and curves in the order from the low concentration to high concentration:
0 (negative control)
0.0001 (1/10000 field rate)
0.01 (1/100 field rate)
1 (field rate)
However, 0.0001 was presented as the scientific number 1e-04
in the ggsurvplot
and therefore the legend order was strange:
0
0.01
1
1e-04
This issue also happened in my other bioassays with a serial dilution of many concentrations because the legend was in order alphabetically instead of numerically.
I want to order the legend of Kaplan Meier curves based on the concentrations of the pesticide.
Xuan Cheng is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1