正規分布のグラフ
# Graph of normal probability density function, with comb of intervals.
meanval = 162 # Specify mean of distribution.
sdval = 15 # Specify standard deviation of distribution.
xlow = meanval - 3.5*sdval # Specify low end of x-axis.
xhigh = meanval + 3.5*sdval # Specify high end of x-axis.
dx = sdval/10 # Specify interval width on x-axis
# Specify comb of points along the x axis:
x = seq( from = xlow , to = xhigh , by = dx )
# Compute y values, i.e., probability density at each value of x:
y = ( 1/(sdval*sqrt(2*pi)) ) * exp( -.5 * ((x-meanval)/sdval)^2 )
# Plot the function. "plot" draws the intervals. "lines" draws the bell curve.
df = data.frame(x,y)
g = ggplot() + geom_line(data=df, mapping=aes(x=x, y=y))
print(g)