problem
I'm trying to make a step-down survival plot using type = "S". I'm plotting a survival curve for every treatment (8 treatments) and each treatment should have its own style, a combination of colors, line widths, and line types. When I designate a style for each line, every line populates in the first style given. For example, when I say "lty = c(3,3,1,1,3,3,1,1)" what I get is a graph that looks like I typed "lty = 3". Please help!
data
structure(list(X = c(1L, 2L, 3L, 4L, 5L, 6L, 24L, 25L, 26L, 27L,
28L, 29L, 47L, 48L, 49L, 50L, 51L, 52L, 70L, 71L, 72L, 73L, 74L,
75L, 93L, 94L, 95L, 96L, 97L, 98L, 116L, 117L, 118L, 119L, 120L,
121L, 139L, 140L, 141L, 142L, 143L, 144L, 162L, 163L, 164L, 165L,
166L, 167L), trt = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 3L, 3L,
3L, 3L, 3L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 4L, 4L, 4L, 4L, 4L, 4L,
5L, 5L, 5L, 5L, 5L, 5L, 7L, 7L, 7L, 7L, 7L, 7L, 6L, 6L, 6L, 6L,
6L, 6L, 8L, 8L, 8L, 8L, 8L, 8L), .Label = c("broomlivedrought",
"broomlivewet", "broomsteriledrought", "broomsterilewet", "uninvadedlivedrought",
"uninvadedlivewet", "uninvadedsteriledrought", "uninvadedsterilewet"
), class = "factor"), day = c(0L, 13L, 14L, 15L, 17L, 20L,
0L, 13L, 14L, 15L, 17L, 20L, 0L, 13L, 14L, 15L, 17L, 20L, 0L,
13L, 14L, 15L, 17L, 20L, 0L, 13L, 14L, 15L, 17L, 20L, 0L, 13L,
14L, 15L, 17L, 20L, 0L, 13L, 14L, 15L, 17L, 20L, 0L, 13L, 14L,
15L, 17L, 20L), totalsurv = c(87L, 87L, 84L, 83L, 82L, 79L, 89L,
89L, 89L, 89L, 88L, 86L, 88L, 88L, 88L, 88L, 88L, 88L, 89L, 89L,
89L, 89L, 89L, 89L, 86L, 86L, 86L, 86L, 86L, 86L, 86L, 86L, 86L,
86L, 86L, 86L, 89L, 89L, 89L, 89L, 89L, 89L, 90L, 90L, 90L, 90L,
90L, 90L), totalplants = c(87L, 87L, 87L, 87L, 87L, 87L, 89L,
89L, 89L, 89L, 89L, 89L, 88L, 88L, 88L, 88L, 88L, 88L, 89L, 89L,
89L, 89L, 89L, 89L, 86L, 86L, 86L, 86L, 86L, 86L, 86L, 86L, 86L,
86L, 86L, 86L, 89L, 89L, 89L, 89L, 89L, 89L, 90L, 90L, 90L, 90L,
90L, 90L), percentsurv = c(100, 100, 96.551724137931, 95.4022988505747,
94.2528735632184, 90.8045977011494, 100, 100, 100, 100, 98.876404494382,
96.6292134831461, 100, 100, 100, 100, 100, 100, 100, 100, 100,
100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
100)), row.names = c(1L, 2L, 3L, 4L, 5L, 6L, 24L, 25L, 26L, 27L,
28L, 29L, 47L, 48L, 49L, 50L, 51L, 52L, 70L, 71L, 72L, 73L, 74L,
75L, 93L, 94L, 95L, 96L, 97L, 98L, 116L, 117L, 118L, 119L, 120L,
121L, 139L, 140L, 141L, 142L, 143L, 144L, 162L, 163L, 164L, 165L,
166L, 167L), class = "data.frame")
code
plot(dfz$percentsurv ~ dfz$dayssurv,
col = c(rep("darkgoldenrod1",4),rep("chartreuse4",4)),
lty = c(3,3,1,1,3,3,1,1),
lwd = c(2,1,2,1,2,1,2,1),
type = "S"
)