![]() ![]() Note that ggplot2 works with normal ame's, and not with the spatial objects of the sp-package. ggplot2 is more flexible and has a more clear syntax. I personally prefer using ggplot2 over spplot. Before there were smartphones, map grids were used to help people travel from one place to another. Reading a polygonset into R can be done using the rgdal package, or the maptools package ( readShapeLines). Where cntry_boundaries is a SpatialLines(DataFrame), or SpatialPolygons(DataFrame). Overlaying additional information such as country boundaries can be done using the sp.layout argument: spplot(df, "value", sp.layout = list("sp.lines", cntry_boundaries)) ![]() ![]() There are roughly two options: one using the lattice and sp package and the other using the ggplot2 package: lattice / spįirst you have to transform your data to a SpatialPixelsDataFrame (provided by the sp-package), assuming your data is called df: require(sp) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |