Skip to main content

A Step Further in the Integration of Data Management and Analysis: Pl/R

  • Chapter
  • First Online:

Abstract

This chapter introduces the Pl/R extension, a very powerful alternative to integrate the features offered by R in the database in a gapless workflow. Pl/R is a loadable procedural language that allows the use of the R engine and libraries directly inside the database, thus embedding R scripts into SQL statements and database functions and triggers. Among many advantages, Pl/R avoids unnecessary data replication, allows the use of a single SQL interface for complex scripts involving R queries and offers a tight integration of data analysis and management processes into the database. In this chapter, you will have a basic overview of the potential of Pl/R for the study of GPS locations. You will be introduced to the use of Pl/R, starting with exercises involving simple calculations in R (logarithms, median and quantiles), followed by more elaborated exercises designed to compute the daylight times of a given location at a given date, or to compute complex home range methods.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   129.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Hardcover Book
USD   169.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 1.

    See the official website here: http://www.joeconway.com/web/guest/pl/r.

  2. 2.

    See http://www.joeconway.com/plr/doc/plr-install.html for more details.

  3. 3.

    To download and install R, check your preferred CRAN mirror: http://cran.r-project.org/mirrors.html.

  4. 4.

    See http://www.joeconway.com/plr/doc/plr-data.html.

  5. 5.

    http://www.postgresql.org/docs/9.2/static/functions-aggregate.html.

  6. 6.

    http://www.joeconway.com/plr/doc/plr-pgsql-support-funcs.html.

  7. 7.

    See the list on CRAN: http://cran.r-project.org/web/packages/available_packages_by_name.html.

  8. 8.

    This example is based on, and extends, a tutorial from George MacKerron: http://blog.mackerron.com/2012/10/15/sunrise-sunset-postgis-plr/.

  9. 9.

    For more details, see: http://www.esrl.noaa.gov/gmd/grad/solcalc/calcdetails.html.

  10. 10.

    See: http://www.joeconway.com/plr/doc/plr-module-funcs.html.

  11. 11.

    See ?timezone in R for more details on the time zone format.

  12. 12.

    http://cran.r-project.org/web/packages/adehabitatHR/.

  13. 13.

    See for instance MapServer: http://mapserver.org/.

  14. 14.

    See an example here: http://www.joeconway.com/web/guest/pl/r/-/wiki/Main/Bytea+Graphing+Example.

  15. 15.

    Another solution might be to use the TerraLib library, which involves another set of dependencies: http://www.terralib.org/.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Mathieu Basille .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this chapter

Cite this chapter

Basille, M., Urbano, F., Conway, J. (2014). A Step Further in the Integration of Data Management and Analysis: Pl/R. In: Urbano, F., Cagnacci, F. (eds) Spatial Database for GPS Wildlife Tracking Data. Springer, Cham. https://doi.org/10.1007/978-3-319-03743-1_11

Download citation

Publish with us

Policies and ethics