this is my code to make a plot. The problem is, now I want to add one more curve to the plot, which is for another variable in the data.frame -log10(results_chr_p$p). My question is: how to make multiple lines in one plot, especially when using the 'running' function in it??
As Remko mentioned, it really is polite to say what package your
function is from if its not one of the basics (such as base or stats).
Also, it is nice to give us sample data (side note, both of these
things are mentioned in the posting guide which you may find here:
In any case I was able to search and find what is most likyle the
function you are using. Although it does not make particular sense,
here is an example plot with two sets of different lines added. They
incorporate results from running(), although the general plot() and
lines() function do not really care where the x and y values came
dat <- runif(100)
plot(dat, running(dat, width = 5, pad = TRUE))
lines(dat, running(dat, width=10, fun = median, pad = TRUE))
lines(dat, running(dat, width=10, fun = mean, pad = TRUE), col = "blue")