From 153277867fa9032ecf28b728986b3ee1c49a548f Mon Sep 17 00:00:00 2001 From: Paul-Antoine Date: Mon, 24 Apr 2017 18:00:05 +0200 Subject: [PATCH] new vignette --- .gitignore | 1 + DESCRIPTION | 5 ++++- vignettes/banR.Rmd | 44 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 vignettes/banR.Rmd diff --git a/.gitignore b/.gitignore index 8da4812..3960439 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .Rhistory .Rproj.user/ .Rproj.user +inst/doc diff --git a/DESCRIPTION b/DESCRIPTION index 0c1fc67..3d3e593 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -20,8 +20,11 @@ Imports: purrr, magrittr Suggests: - testthat + testthat, + knitr, + rmarkdown RoxygenNote: 6.0.1 Encoding: UTF-8 URL: http://github.com/joelgombin/banR BugReports: http://github.com/joelgombin/banR/issues +VignetteBuilder: knitr diff --git a/vignettes/banR.Rmd b/vignettes/banR.Rmd new file mode 100644 index 0000000..eed5369 --- /dev/null +++ b/vignettes/banR.Rmd @@ -0,0 +1,44 @@ +--- +title: "BanR" +author: "Vignette Author" +date: "`r Sys.Date()`" +output: rmarkdown::html_vignette +vignette: > + %\VignetteIndexEntry{Vignette Title} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- + +```{r setup} +library("dplyr") +library("banR") +``` + +* `geocode()` takes a single address and return a tibble + +```{r geocode} +geocode(query = "8 boulevard du port") %>% + glimpse() +``` + +* `reverse_geocode()` takes a couple of latitude and longitude and returns a tibble + +```{r reverse} +reverse_geocode(long = 2.37, lat = 48.357) %>% + glimpse() +``` + + +* `ban_geocode()` takes a data frame as input with name and code insee and returns a geocoded data frame + +```{r geocode-df} +data("paris2012") + +paris2012 %>% + slice(1:10) %>% + mutate(adresse = paste(numero, voie, nom), + code_insee = paste0("751", arrondissement)) %>% + ban_geocode(adresse, code_insee = "code_insee") %>% + glimpse() +``` +