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
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsNotes
- 1.
See the official website here: http://www.joeconway.com/web/guest/pl/r.
- 2.
See http://www.joeconway.com/plr/doc/plr-install.html for more details.
- 3.
To download and install R, check your preferred CRAN mirror: http://cran.r-project.org/mirrors.html.
- 4.
- 5.
- 6.
- 7.
See the list on CRAN: http://cran.r-project.org/web/packages/available_packages_by_name.html.
- 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.
For more details, see: http://www.esrl.noaa.gov/gmd/grad/solcalc/calcdetails.html.
- 10.
- 11.
See ?timezone in R for more details on the time zone format.
- 12.
- 13.
See for instance MapServer: http://mapserver.org/.
- 14.
See an example here: http://www.joeconway.com/web/guest/pl/r/-/wiki/Main/Bytea+Graphing+Example.
- 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
Corresponding author
Editor information
Editors and Affiliations
Rights 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
DOI: https://doi.org/10.1007/978-3-319-03743-1_11
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-03742-4
Online ISBN: 978-3-319-03743-1
eBook Packages: Biomedical and Life SciencesBiomedical and Life Sciences (R0)