Let's take sample 'y' of length 100 from N(0,1) distribution and function g(x)=x^2+7.
I want to make a graph of function $h(x)=\sum_{i=1}^{100}g(x-y[i])$
So
y=rnorm(100,0,1)
g=function(x){x^2+7}
h=function(x){sum(g(x-y))}
And now expressions like
curve(h)
plot(h)
lines(h)
doesnt work, can You please help me how can i draw graph of function h?