dwellings | R Documentation |
The data are generated with residence/household locations from the Dutch open data BAG register. The locations are realistic, but the associated data is simulated.
dwellings
a data.frame
with 90603 rows and 4 columns.
integer, x coordinate of dwelling (crs 28992)
integer, y coordinate of dwelling (crs 28992)
numeric, simulated continuous value
logical, simulated discrete value
Basisregistratie Adressen en Gebouwen https://www.kadaster.nl/zakelijk/registraties/basisregistraties/bag/bag-producten
# dwellings is a data.frame, the best way is to first turn it # into a sf or sp object. # create an sf object from our data if (requireNamespace("sf")){ dwellings_sf <- sf::st_as_sf(dwellings, coords=c("x", "y"), crs=28992) unemployed <- sdc_raster( dwellings_sf , "unemployed" , r=200 , max_risk = 0.9 ) plot(unemployed) sensitivity_score(unemployed) unemployed_smoothed <- protect_smooth(unemployed, bw = 0.4e3) plot(unemployed_smoothed, main="Employment rate") plot(unemployed_smoothed, "sum", main = "Employment") } else { message("Package 'sf' was not installed.") } dwellings_sp <- dwellings # or change a data.frame into a sp object sp::coordinates(dwellings_sp) <- ~ x + y tryCatch( # not working on some OS versions. sp::proj4string(dwellings_sp) <- "+init=epsg:28992" ) consumption <- sdc_raster(dwellings_sp, dwellings_sp$consumption, r = 500) consumption plot(consumption) # but we can also create a raster directly from a data.frame unemployed <- sdc_raster( dwellings[c("x","y")], dwellings$unemployed)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.