Description Usage Arguments Value Note Author(s) See Also Examples
plot.shp
plots a list of shapes
1 2 3 |
x |
|
xlim |
range to plot in |
ylim |
range to plot in |
asp |
aspect ratio; the default ensures least distortion in the center of the image |
add |
logical; if |
axes |
logical; passed to |
.
full |
logical; if |
hold |
logical; if |
col |
colors for the shapes; each shape (possibly consisting of multiple polygons) consumes one element |
border |
borders for the shapes; consumer and recycled jsut like
|
... |
additional arguments |
NULL
invisibly
It is most efficient to plot the result of read.shp(...,
format="list")
. All other types are converted into that type before
plotting. It is most inefficient to use format="table"
.
Simon Urbanek
1 2 3 4 5 6 7 8 9 10 11 | # Census 2010 TIGER/Line(TM) state shapefile
fn <- system.file("shp", "tl_2010_us_state10.shp.xz", package="fastshp")
# contrary to the advice above we use the table format, because
# it is a huge file with many points, so we use constrained thinning
# which works on tables
s <- read.shp(xzfile(fn, "rb"), "table")
# substantially reduce the number of points
s <- s[thin.shp(s, 0.01),]
# focus on continental US only
q <- list(x=c(-127.35, -65), y = c(51.5, 22.23))
plot.shp(s, q$x, q$y)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.