Free Access Week - Data Engineering + BI
Data Engineering and BI courses are free this week!
Free Access Week - Jun 2-8

rpostgis (version 1.0.0)

rpostgis: R interface to a PostGIS database.

Description

This package provides additional functions to the RPostgreSQL package to interface R with a PostGIS-enabled database, as well as convenient wrappers to common PostgreSQL queries. For a list of documented functions, use library(help = "rpostgis").

Arguments

Details

A typical session starts by establishing the connection to a working PostgreSQL database:

library(rpostgis) con <- dbConnect("PostgreSQL", dbname = , host = , user = , password = )

For example, this could be:

con <- dbConnect("PostgreSQL", dbname = "rpostgis", host = "localhost", user = "postgres", password = "postgres")

The next step typically involves checking if PostGIS was installed on the working database, and if not try to install it:

pgPostGIS(con)

The function should return TRUE for all pg- functions to work.

Finally, at the end of an interactive session, the connection to the database should be closed:

dbDisconnect(con)