Added library(lattice) at the top so that it would be done upon sourcing the file.