James Buckley
James Buckley

Reputation: 1

projection(raster) = NA but raster has a set crs

So I have a list of rasters which have a set crs, resolution and extent etc. I am aiming to merge some of them together however when i try to use the merge function i get the error: Error in as.data.frame(x) : argument "x" is missing, with no default

So to investigate this further i ran projection(raster1) and R came back with NA which is confusing because when run 'raster1' it shows a crs assigned to the raster

I'm not sure how to set the projection of this list of rasters and was wondering if anyone could help? Ive already tried things like: `sapply(rasters, function(x) projectRaster(x, crs='+proj etc')' 'projection(raster) = '+proj...'' 'crs(raster) = '+proj...''

Upvotes: 0

Views: 464

Answers (1)

Robert Hijmans
Robert Hijmans

Reputation: 47146

My best guess is that you need to name the first elements of your list

names(yourlist) <- c("x", "y")

Upvotes: 0

Related Questions