[R-sig-Geo] Shifting x coordinates by 180

Michael Sumner mdsumner at gmail.com
Thu Oct 16 10:52:58 CEST 2014


Why not just use elide as you stated?

Why are you using coordinates()<-?

??



On Wed, Oct 15, 2014 at 7:33 PM, Leigh Kroeger <leigh.kroeger at gmail.com> wrote:
> Hello,
>
> I have the following shapefile imported into R:
>
>> summary(grid)
> Object of class SpatialPolygonsDataFrame
> Coordinates:
>          min        max
> x -165.73220 -123.23912
> y   29.55567   46.44211
> Is projected: FALSE
> proj4string : [+proj=longlat +ellps=WGS84]
>
> I need to shift 'x' by adding 180 to the data column. I think the 'elide'
> function in maptools can accomplish this but the following error comes up
> when I start the code:
>
>>coordinates(grid) <- c("x", "y")
> Error in `coordinates<-`(`*tmp*`, value = c("x", "y")) :   setting
> coordinates cannot be done on Spatial objects, where they have already been
> set
>
> My intended outcome is to be able to plot occurrence data from GBIF onto
> the polygon shapefile.
>
> Regards,
>
> --
> *Leigh A. Kroeger*
> <*)))><
>
> *PhD Candidate - Marine Ecology*
> המחלקה למדעי החיים
> אוניברסיטת תל אביב
> Dept. of Zoology
> Tel Aviv University
> Tel Aviv, 69978
> Israel
> Tel: +03 640-7830
>
> http://belmaker.weebly.com/members.html
> http://www.linkedin.com/profile/view?id=144722403&trk=nav_responsive_tab_profile_pic
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo



-- 
Michael Sumner
Software and Database Engineer
Australian Antarctic Division
Hobart, Australia
e-mail: mdsumner at gmail.com



More information about the R-sig-Geo mailing list