make_map_page: Make a map page for the Jekyll site

Description Usage Arguments Value Examples

View source: R/template.R

Description

This function generates an R Markdown page which in turn generates the map view page in the Jekyll website. The R Markdown file will be created in the directory passed to the function (presumably the _maps) directory in Jekyll). It contains the YAML metadata header plus the R code that creates the maps and tables. This file will need to be edited by hand to include text and captions, so by default this function will not overwrite the created file. The R Markdown file has to be run separately to create the Markdown file used by Jekyll.

Usage

1
make_map_page(meae_id, ..., dir, overwrite = FALSE)

Arguments

meae_id

The MEAE ID of the map to be created.

...

Additional arguments passed on to generate_map_metadata.

dir

The directory in which to create R Markdown file. The file will be named after the meae_id.

overwrite

If the file already exists, should it be overwritten?

Value

Invisibly returns the path to the file that was created.

Examples

1
2
3
4
meae_id <- "meae.congressional.congress08.va.county"
# The function invisibly returns the path to the file it created
file <- make_map_page(meae_id, dir = tempdir(), overwrite = TRUE)
cat(readr::read_file(file))

mapping-elections/mappingelections documentation built on July 24, 2019, 9:42 a.m.