Skip to content

package: maps and spatstat question

2 messages · Laura Chihara, Hadley Wickham

#
I would like to use the output from the map function
in the package maps for use in, say, the spatstat
package. I don't quite understand the coordinates
for the border of the state:
Example:

library(maps)
iowa<-map("region","iowa)

x<-iowa$x
y<-iowa$y

There are NA's and duplicated coordinates.
What would I need to do to use this in the
spatstat owin command?
owin(poly= ?)

Thank you.

-- Laura

************************************************
Laura Chihara
Professor of Mathematics  507-222-4065 (office)
Dept of Mathematics       507-222-4312 (fax)
Carleton College
1 North College Street
Northfield MN 55057
#
Hi Laura,

You might find the map_data function from the ggplot2 package helpful:

library(ggplot2)
library(maps)
head(map_data("state", "iowa"))

It formats the output of the map command into a self-documenting data frame.

Hadley
On Mon, Apr 6, 2009 at 7:00 AM, Laura Chihara <lchihara at carleton.edu> wrote: