Hello All,

I am using "sp" and "maps" libraries to have a map for some fire data.
The region covered is Mississippi State in the US. Then I would like to
add a layer of ecoregion on the top (omenrik layer from
nationalatlas.gov). The problem is that the ecoregion layer is larger
than the state boundary. How can I get rid of these ecoregion areas out
of MS state?

The code is like this:

# Both data.fire and data.ecoregion are class of
SpatialPolygonsDataFrame.
# Every fire is within the state boundary so it looks nice.
# Some ecoregions go beyond the state boundary.

library(sp); library(maps)
win.graph(width=4, height=6)
map('state', region = 'mississippi', col='red')
plot(data.fire, add=T) 
plot(data.ecoregion, add=T)

Any hint is greatly appreciated.



Edwin

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to