Dear List,

I am attempting to produce a plot similar to that of Figure 6.5 (
http://lmdvr.r-forge.r-project.org/figures/figures.html) in Deepayan
Sarkar's excellent Lattice book. The plot requires the re-scaling the base
map such that it is viewed from a 3D perspective. Deepayan suggests the
following function for this:

# Produce 3d map with bars: need to define function that draws boundaries on
an x y plane
  library(maps)
  state.map<-map("state", plot=FALSE, fill=FALSE)
  panel.3dmap<-function(...,rot.mat, distance, xlim, ylim, zlim,
            xlim.scaled, ylim.scaled, zlim.scaled)
  {
  scale.vals<-function(x, original, scaled) {
    scaled[1] + (x-original[1]) * diff(scaled) / diff(original)
  }
  scaled.map<-rbind(scale.vals(state.map$x, xlim, xlim.scaled),
            scale.vals(state.map$y, ylim, ylim.scaled),
            zlim.scaled[1])
  m<- ltransform3dto3d(scaled.map, rot.mat, distance)
      panel.lines(m[1,], m[2,], col="grey76")
  }

Using the maps database I can see how the state.map can be subset into its x
and y coordinates for the functions above. Is it possible to apply the same
type of function to an ESRI shapefile read in to R (using readShapePoly,
readShapeLines or readOGR)? I guess my primary problem is being unable to
access the string of coordinates that produce the polygons/lines. I have
searched the forums/ literature as best I could and found nothing. Any
suggestions of intelligent search terms or packages/ helpfiles will be
greatly appreciated.

Kind Regards,

James

	[[alternative HTML version deleted]]


