Input the limits of a 2D space and the desired image resolution, then the function outputs the appropriate grid/lattice coordinates.
generate_grid(im.res, xlim = c(0, 1), ylim = c(0, 1))A data frame whose first column is x-coordinates and whose second column is y-coordinates.
A vector specifying the dimension/resolution of the image. The first entry is the number of 'rows' in the lattice/image, and the second entry is the number of columns' in the lattice/image.
These are the 2D image limits. Defaults for both are
c(0, 1). It is not recommended to alter these arguments unless
changing the limits has a specific practical utility.