library(ggplot2)
# Graph of normal probability density function, with comb of intervals.
xlow = 0 # Specify low end of x-axis.
xhigh = 1 # Specify high end of x-axis.
dx = 0.01 # 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 = 6*x*(1-x)
# 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)
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
List of users who liked
00