Title: Create Tile-Grid Geographical Maps
Version: 0.1.0
Description: The 'tabularmap' is one of the visualization methods for efficiently displaying data consisting of multiple elements by tiling them. When dealing with geospatial, it corrects for differences in visibility between areas.
License: CC BY-SA 4.0
URL: https://github.com/uribo/tabularmaps
BugReports: https://github.com/uribo/tabularmaps/issues
Depends: R (≥ 3.3.0)
Imports: ggforce (≥ 0.3.2), ggplot2 (≥ 3.3.0), purrr (≥ 0.3.4), rlang (≥ 0.4.7)
Suggests: countrycode, zipangu, knitr, rmarkdown, testthat (≥ 2.1.0)
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.1
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2020-07-29 22:10:27 UTC; uri
Author: Shinya Uryu ORCID iD [aut, cre]
Maintainer: Shinya Uryu <suika1127@gmail.com>
Repository: CRAN
Date/Publication: 2020-08-04 09:00:02 UTC

Country list

Description

A data frame include ISO-3166 codes.

Usage

iso3166

Format

A data frame with 250 rows 8 variables:


Japan 7x7 grid dataset

Description

Prefectures dataset.

Usage

jpn77

Format

A data frame with 47 rows 8 variables:


Coloring the tabularmaps by region in Japan

Description

Custom ggplot2 scale for tabulamap.

Usage

scale_fill_jpregion(lang, ...)

Arguments

lang

Select whether the region variable is Japanese (jp) or English (en).

...

all other arguments passed on to ggplot2::scale_fill_manual()


Create Tile-Grid

Description

A ggplot2-based tabularmap that places a coordinated dataset in a rectangle.

Usage

tabularmap(
  data,
  x,
  y,
  group,
  fill = NULL,
  label = NULL,
  ...,
  .expand_size = 10,
  .radius_size = 2
)

Arguments

data

data.frame. Contain x, y, group and label variables used as coordinates.

x, y

A column containing the numbers to line up the items.

group

Group variable.

fill

Fill colour variable.

label

Label variable.

...

All other arguments passed on to ggplot2::geom_text() include label family.

.expand_size

The value specified in the expand argument of ggforce::geom_shape(). The unit is in mm.

.radius_size

The value specified in the radius argument of ggforce::geom_shape(). The unit is in pt.

Examples

library(ggplot2)
tabularmap(jpn77, x, y, group = jis_code, label = prefecture, size = 3)
tabularmap(jpn77, x, y, group = jis_code, fill = region, label = prefecture, size = 3) +
  theme_tabularmap() +
  scale_fill_jpregion(lang = "en")
tabularmap(data.frame(
             id = letters[seq.int(9)],
             x = rep(c(1,2,3), each = 3),
             y = rep(c(1,2,3), times = 3),
             fill = seq.int(9),
             label = letters[seq.int(9)]),
  x, y,
  group = id,
  fill = fill,
  label = label,
  .expand_size = 20, .radius_size = 10)
tabularmap(iso3166, x, y, group = iso2c,
           fill = continent,
           label = iso2c,
           .expand_size = 5) +
  theme_tabularmap() +
  guides(fill = FALSE)

Tabularmap theme

Description

Custom ggplot2 theme for tabulamap.

Usage

theme_tabularmap(...)

Arguments

...

all other arguments passed on to ggplot2::theme_minimal()


Special wards of Tokyo

Description

Tokyo 23 wards dataset.

Usage

tky23

Format

A data frame with 23 rows 5 variables: