[R] package: maps and spatstat question

hadley wickham h.wickham at gmail.com
Mon Apr 6 14:44:59 CEST 2009


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:
>
> 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
>
> ______________________________________________
> R-help at r-project.org 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.
>



-- 
http://had.co.nz/



More information about the R-help mailing list