This document produces basic plots.
The first code chunk sets the seed to ensure reproducibility, and creates x
and y
variables.
set.seed(1234)
x = rnorm(1000)
y = 1 + 2 * x + rnorm(1000, 0, .4)
Next we use a code chunk to produce a histogram of x
. The fig.width
and fig.height
options control the size of the resulting plot.
hist(x)
Next we show a scatterplot, similarly controlling the figure size using options.
plot(x, y)