My blog about coding and stuff.
Download as R Markdown.
Mathematical expressions can be included in the plot title or axis labels. For more information, see ?plotmath or run the demo with demo(plotmath).
Here are some quick examples.
plot(0, 0, main = expression(theta == 0), ylab = expression(hat(gamma) == 0),
xlab = expression(sum ...
in R · Tue 15 October 2013
The lattice library is useful for quickly making plots of multivariate data. It's easy to make plots which condition on one or more variables.
# Ask for general information about the lattice package
# See what is inside of ...
in R · Mon 14 October 2013
mapply gives us a way to call a non-vectorized function in a vectorized way.
From the R Documentation:
mapply is a multivariate version of sapply. mapply applies FUN to
the first elements of each ... argument, the second elements,
the third elements, and so on. Arguments are ...
in R · Sun 13 October 2013
Apply a function over subsets of a vector.
x <- c(rnorm(10), runif(10), rnorm(10, 1))
##  -2.04333 0.72651 1.55476 -0.12411 1.08133 -0.30514 1.38638
##  0.35047 0.88147 1 ...