With a basic loop you could try something like:
for(i in 1:length(N)) {
add <- if(i == 1) FALSE else TRUE
curve( df(f[i], df1[i], df2[i], ncp = (x * N[i]) / (1 - x) ) ,
col = i, lwd = 3, from = 0, to = 1, n = 1e4, add=add)
}
Not the prettiest but using the basics. You should definitely explore ggplot2.
To avoid that some curves not complete, you could first get the values for each curve, estimate their ranges and then plot them. For example:
# function to get the values of each curve
curve_ <- function(x, i) df(f[i], df1[i], df2[i], ncp = (x * N[i]) / (1 - x))
# estimate the values of each curve
curves <- lapply(1:length(N), function(i) {
x <- seq(0,1,length.out = 1e4)
curve_(x, i)
})
# estimate the ranges
ranges_ <- sapply(curves, range, na.rm=T)
# plot using the ranges as plotting parameters (ylim)
for (i in 1:length(curves)) {
if(i == 1) {
plot(curves[[i]], type='l', col=i, xlim=c(0,length(curves[[i]])), ylim=c(min(ranges_[1,]), max(ranges_[2,])))
} else {
lines(curves[[i]], col=i)
}
}