@GavinSimpson has already commented on how to fix your problem. It should have been a comment, but it's too long. I am simply explaining what happened to your plot with your data in its original form.
You draw data of type factor . Therefore, when you call the plot function, the S3 method dispatcher will call plot.factor .
If you read the help for ?plot.factor , you will notice that the type of graph that you then receive also depends on the type of your second parameter. Since this is also a factor, ultimately your plot is drawn by spineplot . Thus, your type="l" is essentially ignored. The color is red, although ...
Reverse engineering your data, I get something like this:
X <- data.frame( Time = sort(sample(letters, 100, replace=TRUE)), Server = sample(c("PortalServer1", "PortalServer2"), 100, replace=TRUE), HeapFreePercent = runif(100)) str(X) P1 <- subset(X, Server=="PortalServer1") P2 <- subset(X, Server=="PortalServer2") plot(P1$Time, P1$HeapFreePercent, type="l", col="red") lines(P2$Time, P2$HeapFreePercent, col="green")

Andrie
source share