Git Product home page Git Product logo

btb's Introduction

Beyond the Border

R-CMD-check

CRAN_Status

btb ("Beyond the Border - Kernel Density Estimation for Urban Geography") is an R package which provides functions dedicated to urban analysis and density estimation using the KDE (kernel density estimator) method.

A partial transposition of the package in Python is also available: btbpy.

Description

The btb_smooth() function allows you to square and smooth geolocated data. It calculates a classical kernel smoothing (conservative) or a geographically weighted median. There are four major call modes of the function.

  • The first call mode is btb_smooth(obs, epsg, cellsize, bandwidth) for a classical kernel smoothing and automatic grid.
  • The second call mode is btb_smooth(obs, epsg, cellsize, bandwidth, quantiles) for a geographically weighted median and automatic grid.
  • The third call mode is btb_smooth(obs, epsg, cellsize, bandwidth, centroids) for a classical kernel smoothing and user grid.
  • The fourth call mode is btb_smooth(obs, epsg, cellsize, bandwidth, quantiles, centroids) for a geographically weighted median and user grid.

Installation

btb is available on CRAN and can therefore be readily installed

install.packages("btb")

To get a bug fix or to use a feature from the development version, you can install the development version of from GitHub :

install.packages("devtools")
devtools::install_github("InseeFr/btb")

Usage

Details on how to use the package can be found in its documentation. Some applications for spatial smoothing are presented in chapter 8 of the Handbook of Spatial Analysis published by Insee. You advise you to start by consulting the vignette of the package

Contributions

Maintainer: Kim Antunez [email protected]

Creators, authors and contributors:

  • Arlindo DOS SANTOS [aut],
  • François SEMECURBE [aut],
  • Julien PRAMIL [aut]
  • Kim ANTUNEZ [cre, ctb],
  • Auriane RENAUD [ctb],
  • Farida MAROUCHI [ctb]
  • Joachim TIMOTEO [ctb]

References

  • Geographically weighted summary statistics : a framework for localised exploratory data analysis, C.Brunsdon & al., in Computers, Environment and Urban Systems C.Brunsdon & al. (2002) doi:10.1016/S0198-9715(01)00009-6
  • Statistical Analysis of Spatial and Spatio-Temporal Point Patterns, Third Edition, Diggle, pp. 83-86, (2003) doi:10.1080/13658816.2014.937718.

btb's People

Contributors

antuki avatar arlindodossantos avatar avouacr avatar kantunez avatar rlesur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

btb's Issues

Error: sEPSG not valid

Hello,

On line 177 of btb_smooth.R, you check that the length of the sEPSG argument is equal to 4 characters when the function is provided with a sf object:

stopifnot("sEPSG not valid "= identical(nchar(as.character(sEPSG)),4L))

However, the epsg code could be of a length greater than 4 character. You have such an instance in the second example that you provide:

 # Example 2
 data(reunion)
 # Call mode 1: classic smoothing - automatic grid
 reunionSmoothed <- btb_smooth( pts = reunion,
                                     sEPSG = "32740",
                                     iCellSize = 200L,
                                     iBandwidth = 400L)

reunion is a data.frame, but if you transform it to a sf object and try to run the code, it errors:

 # Example 2
 data(reunion)
reunion <- sf::st_as_sf(reunion, coords = c("x","y"), crs = 32740)
 # Call mode 1: classic smoothing - automatic grid
 reunionSmoothed <- btb_smooth( pts = reunion,
                                     iCellSize = 200L,
                                     iBandwidth = 400L)
Error in btb_smooth(pts = reunion, iCellSize = 200L, iBandwidth = 400L) : 
  sEPSG not valid 

Is there a reason I am not understanding for the check for a epsg length equal to 4?

Thank you, and thank you for your very useful package!

Invalid URLs in vignette

Hi,
While checking the package I get :

Found the following (possibly) invalid URLs:
  URL: http://r.iresmi.net/2019/05/11/kernel-spatial-smoothing-transforming-points-pattern-to-continuous-coverage/ (moved to https://r.iresmi.net/posts/2019/kernel_spatial_smoothing_transforming_points_pattern_to_continuous_coverage/)
    From: inst/doc/btb.html
    Status: 200
    Message: OK
  URL: https://githubmemory.com/repo/SNStatComp/awesome-official-statistics-software
    From: inst/doc/btb.html
    Status: Error
    Message: libcurl error code 7:
      	Failed to connect to githubmemory.com port 443 after 111 ms: Couldn't connect to server
  URL: https://inspire.ec.europa.eu/ (moved to https://knowledge-base.inspire.ec.europa.eu/index_en)
    From: inst/doc/btb.html
    Status: 200
    Message: OK
  URL: https://mobile.twitter.com/DavidZumbach/status/1373166163497213952
    From: inst/doc/btb.html
    Status: 403
    Message: Forbidden
  URL: https://mobile.twitter.com/raffverduzco/status/1128075094524350464?lang=bg
    From: inst/doc/btb.html
    Status: 403
    Message: Forbidden

(for the last 2, Twitter is no longer accessible without an user account)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.