ggplot2 の curve() 関数で add=TRUE 引数を複製する方法がわかりませんか?
このプロットがあるとします
testfn<-function(x,a){
sin(x-a)
}
for(i in 1:10){
curve(testfn(x,i),add=TRUE,xlim=c(-5,5))
}
10 個の +stat_function() を手動で追加することなく、ggplot2 でこれを行うにはどうすればよいですか?
ありがとう