Learn R Programming

simplevis (version 2.4.0)

ggplot_stars_facet: Map of an array in ggplot that is facetted.

Description

Map of an array in ggplot that is facetted, but not coloured.

Usage

ggplot_stars_facet(data, pal = NULL, facet_nrow = NULL,
  title = "[Title]", subtitle = NULL, caption = NULL,
  font_family = "Helvetica", font_size_title = NULL,
  font_size_body = NULL, title_wrap = 70, subtitle_wrap = 80,
  caption_wrap = 80)

Arguments

data

A stars object with 2 dimensions, x and y, and multiple named attribute layers with usual convention of lower case and underscores. These attribute layers will be facetted. Required input.

pal

Character vector of hex codes, or provided objects with pal_ prefixes.

facet_nrow

The number of rows of facetted plots.

title

Title string. Defaults to "[Title]".

subtitle

Subtitle string. Defaults to "[Subtitle]".

caption

Caption title string. Defaults to NULL.

font_family

Font family to use. Defaults to "Helvetica".

font_size_title

Font size for the title text. Defaults to 11.

font_size_body

Font size for all text other than the title. Defaults to 10.

title_wrap

Number of characters to wrap the title to. Defaults to 70.

subtitle_wrap

Number of characters to wrap the subtitle to. Defaults to 80.

caption_wrap

Number of characters to wrap the caption to. Defaults to 80.

Value

A ggplot object.

Examples

Run this code
# NOT RUN {
map_data1 <- example_stars %>%
  rlang::set_names("Variable A")

map_data2 <- example_stars_2 %>%
  rlang::set_names("Variable B")

map_data <- c(map_data1, map_data2)

ggplot_stars_facet(data = map_data)
# }

Run the code above in your browser using DataLab