---
title: "csmaps"
output: rmarkdown::html_vignette
author: "Richard Aubrey White, Chi Zhang"
date: "2021-01-15"
vignette: >
  %\VignetteIndexEntry{csmaps}
  %\VignetteEncoding{UTF-8}
  %\VignetteEngine{knitr::rmarkdown}
editor_options: 
  chunk_output_type: console
---

```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
```

`csmaps` is a package for map visualisation developed by members of [CSIDS](https://www.csids.no). The package contains map data for Norway at different levels geographic granularity and layout. 

```{r setup}
library(csmaps)
library(ggplot2)
library(data.table)
library(magrittr)
```

A map with the default layout can be made in this way. For more advanced *layout* and *customization*, see the relevant documentation vignettes. 

```{r fig.height=6, fig.width=6}
pd <- copy(csmaps::nor_municip_map_b2020_default_dt)
q <- ggplot()
q <- q + geom_polygon(
  data = pd,
  aes( 
    x = long,
    y = lat,
    group = group
  ), 
  color="black", 
  fill="white",
  size=0.1
)
q <- q + theme_void()
q <- q + coord_quickmap()
q <- q + labs(title = "Default layout")
q
```

