I am an absolute beginner of geographic data, so please, forgive me if the question is not appropriate.
I downloaded data from NCDC NARR and managed to load into R using the raster package. I would like to get a list with latitude, longitude and value. I understand that rasterToPoints() should do exactly what I want, however, my latitude and longitude values look strange:
r <- raster(myfile)
data_matrix <- rasterToPoints(r)
head(data_matrix)
x y value
[1,] -5405401 4347242 70
[2,] -5372938 4347242 88
[3,] -5340475 4347242 76
[4,] -5308012 4347242 85
[5,] -5275549 4347242 87
[6,] -5243086 4347242 88
I suppose I should do something with the projection which is currently Lambert Conformal Conic (LCC). Here are further info about the raster.
> r
class : RasterLayer
dimensions : 277, 349, 96673 (nrow, ncol, ncell)
resolution : 32463, 32463 (x, y)
extent : -5648874, 5680713, -4628777, 4363474 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=lcc +lat_1=50 +lat_2=50 +lat_0=50 +lon_0=-107 +x_0=0 +y_0=0 +a=6371200 +b=6371200 +units=m +no_defs
data source : mypath-to-file
names : value
What shall I do to get real US latitude and longitude values?
