Re: [R-sig-Geo] Add coastline to an existing xyplot [SEC=UNCLASSIFIED]

2007-11-02 Thread hiemstra
Hi, You could use the function spplot in the sp-pacakge. Use the sp.layout argument to add the shapefile to the plot. All the data needs to be in one of the Spatial classes provided by the sp-package. The code could look something like: library(sp) library(maptools) points = read.table("points

Re: [R-sig-Geo] Add coastline to an existing xyplot [SEC=UNCLASSIFIED]

2007-11-01 Thread Felix Andrews
plot() is a base graphics function. You can not use it in a Lattice context. And also you can not add to a Lattice plot as you tried to do: you need to use a panel function, or call trellis.focus(). I suggest you read the Lattice documentation. This is one way to do it: library(sp) xyplot(lat ~

[R-sig-Geo] Add coastline to an existing xyplot [SEC=UNCLASSIFIED]

2007-11-01 Thread Jin.Li
Hi there, I tried to add a coastline that is imported from a shapefile to a xyplot of sample points, but I got an error message. > library(lattice) > library(maptools) > xyplot(mud$lat~mud$long, asp="iso", type="p", pch=1, cex=0.01, xlab="", ylab="") > > plot(coastline, add=T) Error in