I have a data set of values over a km grid in the continental U.S. The columns are "latitude", "longitude", and "observation", e.g.:
"lat" "lon" "yield"
25.567 -120.347 3.6
25.832 -120.400 2.6
26.097 -120.454 3.4
26.363 -120.508 3.1
26.630 -120.562 4.4
or, as an R data frame:
mydata <- structure(list(lat = c(25.567, 25.832, 26.097, 26.363, 26.63),
lon = c(-120.347, -120.4, -120.454, -120.508, -120.562),
yield = c(3.6, 2.6, 3.4, 3.1, 4.4)), .Names = c("lat",
"lon", "yield"), class = "data.frame", row.names = c(NA, -5L))
(the full data set can be downloaded as csv here)
The data are output from a crop model (intended to be on) a 30km x 30km grid (from Miguez et al 2012).
How can I convert these to a raster file with GIS - related metadata such as map projection?
Ideally the file would be a text (ASCII?) file because I would like for it to be platform and software independent.
proj +proj=lcc +lat_1=50.0 +lat_2=50.0 +units=km +lon_0=-145.5 +lat_0=1.0
. I am not sure what you are asking for with respect to another csv file - how would it differ from the one linked in to in the question, or that would be produced by the accepted answer?