## Not run:
# ## Retrieve a Spatial*DataFrame with all data from table
# ## 'schema.tablename', with geometry in the column 'geom'
# pgGetGeom(conn, c("schema", "tablename"))
# ## Return a Spatial*DataFrame with columns c1 & c2 as data
# pgGetGeom(conn, c("schema", "tablename"), other.cols = c("c1","c2"))
# ## Return a Spatial*-only (no data frame),
# ## retaining id from table as rownames
# pgGetGeom(conn, c("schema", "tablename"), gid = "table_id",
# other.cols = FALSE)
# ## Return a Spatial*-only (no data frame),
# ## retaining id from table as rownames and with a subset of the data
# pgGetGeom(conn, c("schema", "roads"), geom = "roadgeom", gid = "road_ID",
# other.cols = FALSE, clauses = "WHERE field = 'highway'")
# ## End(Not run)
Run the code above in your browser using DataLab