r tremeaud
unread,Sep 29, 2011, 7:42:23 AM9/29/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ggplot2
i'm trying draw a map with ggplot2
Code:
suisse <- readShapePoly("/Users/raphaeltremeaud/Desktop/Rsig/data/
CHE_adm/CHE_adm1.shp",proj4string=CRS("+proj=longlat +datum=WGS84"))
Sys.setlocale("LC_ALL", locale="C")
suisse <- fortify.SpatialPolygonsDataFrame(suisse,region="NAME_1")
###using merge
Code:
'data.frame': 27 obs. of 2 variables:
$ dat : Factor w/ 27 levels "","Aargau","Appenzell Ausserrhoden",..:
1 2 3 4 5 6 7 8 9 10 ...
$ Freq: int 1 29 10 1 20 28 108 14 27 2 ...
suisse.fusion <- merge(suisse,dat, by.x = "id", by.y = "dat")
suisse.fusion <- suisse.fusion[order(suisse.fusion$order), ]
when i draw using ggplot2 there is an error message "state of graphics
wrong"
Code:
ggplot(suisse.fusion, aes(long, lat)) +
geom_polygon(aes(group=id, fill = Freq))
#####here is my problems
Erreur dans recordGraphics(drawGTree(x), list(x = x),
getNamespace("grid")) :
'etat des graphiques incorrect###<- "state of graphics wrong"
what does it mean ?
think you