[R-sig-Geo] apply() proj4string to list of rasters

Roger Bivand Roger.Bivand at nhh.no
Tue Nov 1 19:39:23 CET 2016


On Tue, 1 Nov 2016, john polo wrote:

> On 11/1/2016 12:59 PM, Barry Rowlingson wrote:
>>  You can do it by rewriting `projection(r) <- Z` as a function, and
>>  assigning it back to the same name. I think this captures the essence:...
> Thanks, Barry for the help. Got another reply that also was helpful.

Please do not privatise received hints, the list is for sharing 
information, not concealing it (the big drone in the server sees it anyway 
...).

My guess is that the underlying problem was the use of lapply() rather 
than a for() loop, and not reading the help page for assigning:

?"proj4string<-"

which does say:

"For ‘proj4string’ CRS object, containing a valid proj4 string"

so value should have been CRS(adpro), or make adpro a CRS first?

Roger

>
> John
>
>

-- 
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 91 00
e-mail: Roger.Bivand at nhh.no
http://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en
http://depsy.org/person/434412


More information about the R-sig-Geo mailing list