| 1 |
|
| 2 |
R : Copyright 2005, The R Foundation for Statistical Computing |
| 3 |
Version 2.1.1 (2005-06-20), ISBN 3-900051-07-0 |
| 4 |
|
| 5 |
R is free software and comes with ABSOLUTELY NO WARRANTY. |
| 6 |
You are welcome to redistribute it under certain conditions. |
| 7 |
Type 'license()' or 'licence()' for distribution details. |
| 8 |
|
| 9 |
R is a collaborative project with many contributors. |
| 10 |
Type 'contributors()' for more information and |
| 11 |
'citation()' on how to cite R or R packages in publications. |
| 12 |
|
| 13 |
Type 'demo()' for some demos, 'help()' for on-line help, or |
| 14 |
'help.start()' for a HTML browser interface to help. |
| 15 |
Type 'q()' to quit R. |
| 16 |
|
| 17 |
> # library(sp) |
| 18 |
> # library(maptools) |
| 19 |
> # data(ncshp) |
| 20 |
> # nc1 <- as.SpatialPolygons.Shapes(nc.shp$Shapes, as.character(nc.shp$att.data$FIPS)) |
| 21 |
> # df <- nc.shp$att.data |
| 22 |
> # rownames(df) <- as.character(nc.shp$att.data$FIPS) |
| 23 |
> # identical(rownames(df), sapply(slot(nc1, "polygons"), function(i) slot(i, "ID"))) |
| 24 |
> # nc <- SpatialPolygonsDataFrame(nc1, df) |
| 25 |
> # |
| 26 |
> # nc$X = factor(sample(1:5,100,replace=T),labels=letters[1:5]) |
| 27 |
> # nc$Y = factor(sample(1:5,100,replace=T),labels=letters[6:10]) |
| 28 |
> # spplot(nc, c("X","Y")) |
| 29 |
> |