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

Leigh Kroeger leigh.kroeger at gmail.com
Wed Oct 15 10:33:47 CEST 2014


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]]



More information about the R-sig-Geo mailing list