---
title: "Dplyr"
author: "Duncan"
date: "4/24/2019"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```





```{r}
require(RPostgreSQL)
require(rpostgis)
require(sf)
require(mapview)
require(tmap)

```

```{r}
conn <- dbConnect("PostgreSQL", host = "postgis",
  dbname = "gis_course" ,user = "docker", password = "docker")
```


```{r}
query<-"create extension plr"
dbSendQuery(conn,query)

query<-"CREATE OR REPLACE FUNCTION test_plr()
RETURNS text AS $$
install.packages('sf', repos='http://cran.us.r-project.org')

$$ LANGUAGE plr;"

dbSendQuery(conn,query)

dbGetQuery(conn,"select test_plr()")
```


```{r}



 
```



