Coerce the data.frame to a matrix and then use the raster function in the raster library to convert the matrix to a raster. This type of object should be in a matrix format to begin with because you save the overhead of row and column names, which data.frame objects must have.
library(raster)
nr = 174
nc = 209
x <- data.frame()
for(i in 1:nr) { x <- rbind(x, runif(nc) ) }
x <- as(x, "matrix")
dim(x)
x <- raster(x)
class(x)
plot(x)
From here you can use writeRaster to export to a variety of formats.
The coordinate system information is incorrect. You can usually find the information in a .e00 file. Here's what it says:
spheroid = GRS80
central meridian/longitude of origin = -96.0
standard parallel 1 = 29.5
standard parallel 2 = 45.5
latitude of origin = 23.0
false easting/false northing = 0.0
so the PROJ.4 string should be:
+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23.0 +lon_0=-96.0 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
To change the CRS of your raster use the crs
command:
crs(r) <- '+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23.0 +lon_0=-96.0 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs'
Then continue re-projecting the coordinates of your sites into the CRS of the raster with the code you have written.
Getting NaNs ("NA") back is sometimes a sign that the input coordinates can't be unprojected/reprojected which in turn can mean that the coordinate system information is incorrect. I've seen those parameter values before, but they weren't assigned to the parameters that I expected.
Best Answer
You are providing spurious information and omitting important information. I do not care that you are plotting over the "wrld_simpl" data but would like to know what the resulting object classes are and if there are any attributes in the SpatialPixelsDataFrame and resulting raster objects. I would ask, why are you projecting to the same projection? The spTransform is completely unnecessary and possible causing you issues.
Please clarify your post to distill it to the actual issue. To assign values, the raster function should just grab the first attribute in the @data slot. However you can specify which column you want by specifying the column name. Here is a quick worked example.