Learn R Programming

btb (version 0.0.7)

smoothing_to_grid: Building of a basemap from smoothed data (Fonction de transformation d un lissage en un fond de carte carroye)

Description

Transforms smoothed data into grid data for export as cartographical data. (Transforme un lissage en un carroyage pour export cartographique.)

Usage

smoothing_to_grid(df,epsg,cell_size=NULL)

Arguments

df
the data.frame obtained from the smoothing (le data.frame obtenu lors du lissage)
epsg
EPSG code (code EPSG de projection)
cell_size
leave empty (ne pas remplir normalement)

Details

Returns a spatialPolygonsdataframe. (Retourne un spatialPolygonsdataframe.)

Examples

Run this code
## Not run: 
# data(reunion)
# # Smoothing of the variable houhold (households) and phouhold (poor households) for Reunion
# # Lissage de la variable houhold(menages) et phouhold(menages pauvres) pour La Reunion
# reunion_smooth=kernel_smoothing(reunion,200,800,c("houhold","phouhold"))
# 
# # Calculating the poverty rate (Calcul du taux de pauvrete)
# reunion_smooth$ratio=reunion_smooth$phouhold/reunion_smooth$houhold*100
# 
# # Building of the associated basemap (Creation du fond de carte associe)
# grid=smoothing_to_grid(reunion_smooth,"32740")
# 
# #library(rgdal)
# # Export of the basemap in shapefile format (Export du fond de carte au format shapefile)
# #writeOGR(grid,"reunion.shp","reunion",driver="ESRI Shapefile")
# ## End(Not run)

Run the code above in your browser using DataLab