Hi Marion,

There is thread on geom_map that can help you with your question.

Best,

Manuel

2012/2/23 marion le texier <marion_letexier@hotmail.fr>

>
> Hi everyone,
>
> I would like to know if someone of you has already got troubles when
> trying to use ggplot2 with a shape file?
> Here is what I've done:
>
> NUTS1<-readShapeSpatial("nuts1_2003",
> proj4string=CRS(projargs=("+init=epsg:3035")),IDvar="NUTS1")
> plot(NUTS1)
>
> NUTS1@data$id <- rownames(NUTS1@data)
>
> # as codes are characters and not numeric values, I've changed them into:
>
> test<-as.numeric(seq(1:94))
> NUTS1@data$id<-test
>
> NUTS1.points <- fortify.SpatialPolygonsDataFrame(NUTS1, region="id")
>
> # The function doesn't want to be applied and I get this error message:
>
> Erreur dans unionSpatialPolygons(cp, invert(polys)) : input lengths differ
> De plus : Message d'avis :
> In split(as.numeric(row.names(attr)), addNA(attr[, region], TRUE)) :
>   NAs introduits lors de la conversion automatique
>
> (sorry for the French comments...)
>
>
> # What I would like to do at the end is :
>
> NUTS1.map <- ggplot()+geom_polygon(data=NUTS1.points, aes(long, lat,
> group=group), fill=NA, colour="black") + coord_map()
>
>
> Do you have any idea of what I'm doing wrong?
>
> Thanks you very much for your help!!!
> Marion
>
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
> --
>
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspinola@una.ac.cr
mspinola10@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

	[[alternative HTML version deleted]]

