I feel like I should be able to accomplish this one with call to lines()
but I have the following:
data <- read.csv(...)
set1 <- subset(data, level='one')
set2 <- subset(data, level='two')
set3 <- subset(data, level='three')
plot(x=data$year, y=data$output)
lines(x=set1$year, y=set1$output, col='red')
lines(x=set2$year, y=set2$output, col='blue')
lines(x=set3$year, y=set3$output, col='green')
This feels like a really 101 application plot
and lines
and I'd just like to make it more efficient, especially given I'll end up having N number of subset
calls.