I want to plot two graphs on one plot. I read this post, but function lines
does not work, nothing happens. I don\'t know what can be the problem. Any ideas?
It "doesn't work" because the y-limits do not include the range of the second vector.
plot(tst_error, type='l', ylim=range( c(tst_error, tr_error) ) )
lines(tr_error, type='l', col='red')
It's not going to be a particularly interesting plot since the scale of the two vectors are so different. The red line's going to look like a completely flat line.