Description Usage Arguments Details Author(s) Examples
Transforms smoothed data into grid data for export as cartographical data.
(Transforme un lissage en un carroyage pour export cartographique.)
| 1 |   smoothingToGrid(grid, epsg, fUpdateProgress = NULL)
 | 
| grid | the  (le  | 
| epsg | EPSG code (code EPSG de projection) | 
| fUpdateProgress | leave empty for the speedest mode; or give a fct to see the compute progress (slower) (ne pas remplir pour utiliser la fonction dans son mode le plus rapide; ou fournir une fonction pour suivre la progresion du traitement (plus lent)) | 
Returns a spatialPolygonsdataframe.
(Retourne un spatialPolygonsdataframe.)
Psar Analyse Urbaine Insee - Thierry Cornely, Laure Genebes, Arlindo Dos Santos, Cynthia Faivre, Auriane Renaud and Francois Semecurbe
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | ## Not run: 
data(reunion)
# Smoothing all variables for Reunion (Lissage de toutes les variables pour la Reunion)
# Call mode 1: classic smoothing - automatic grid
reunionSmooth <- kernelSmoothing(dfObservations = reunion, cellSize = 200
                                , bandwidth = 400)
# Call mode 2: median smoothing - automatic grid
reunionSmooth <- kernelSmoothing(dfObservations = reunion, cellSize = 200
                                , bandwidth = 400, vQuantiles = c(0.1, 0.5, 0.9))
# Call mode 3: classic smoothing - user grid
dfCentroidsUser <- merge( x = seq(from =  314400, to = 378800,  by = 200)
                        , y = seq(from = 7634000, to = 7691200, by = 200))
reunionSmooth <- kernelSmoothing(dfObservations = reunion, cellSize = 200
                                , bandwidth = 400, dfCentroids = dfCentroidsUser)
# Call mode 4: median smoothing - user grid
reunionSmooth <- kernelSmoothing(dfObservations = reunion, cellSize = 200
                                , bandwidth = 400, vQuantiles = c(0.1, 0.5, 0.9)
                                , dfCentroids = dfCentroidsUser)
# Building of the associated basemap (Creation du fond de carte associe)
grid <- smoothingToGrid(reunionSmooth, "32740")
# preview (Apercu)
library(sp)
library(cartography)
cartography::choroLayer(grid, var = "houhold", nclass = 5
                      , method = "fisher-jenks", border = NA)
# Export of the basemap in shapefile format (Export du fond de carte au format shapefile)
library(rgdal)
rgdal::writeOGR(grid, "reunion.shp", "reunion", driver = "ESRI Shapefile")
## End(Not run)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.