[R] Change Y-axis labels
Medic
m@|||P@dpo@t @end|ng |rom gm@||@com
Wed Sep 4 16:35:30 CEST 2019
The Y scale is divided (by default) as:
0.0 ... 0.2 ... 0.4 ... 0.6 ... 0.8 ...1.0
But I would like so:
0 ... 20 ... 40 ... 60 ... 80... 100
(with rotating axis labels)
When I use par function (marked as comment here) it turns out
correctly for ONLY ONE picture?! Help me, please. (This is the code
for restricted mean survival time.)
install.packages("survival")
install.packages("survRM2")
library(survival)
library(survRM2)
#automatically creates a sample data
D=rmst2.sample.data()
time=D$time
status=D$status
arm=D$arm
tau=NULL
a=rmst2(time, status, arm, tau=10)
#par(yaxt="n")
plot(a, xlab="Years", ylab="Probability", density=60)
#par(yaxt="s")
#axis(side = 2, at = seq(0, 1, 0.2), labels = seq(0, 100, 20), las = 1)
More information about the R-help
mailing list