Learn R Programming

RCaucTile (version 1.0.3)

ec_tile_map: Draw a grid tile map for East Caucasian languages.

Description

Draw a grid tile map for East Caucasian languages.

Usage

ec_tile_map(
  data = NULL,
  feature_column = "feature",
  title = NULL,
  title_position = "left",
  annotate_feature = FALSE,
  abbreviation = TRUE,
  hide_languages = NULL,
  rename_languages = NULL,
  tile_colors = NULL,
  palette_reverse = FALSE
)

Value

a `ggplot2` object

Arguments

data

Could be NULL, then it will print the language template. Otherwise should be a dataframe with language column annotated with some feature. Default value is NULL.

feature_column

Character vector of length 1 which specifies the column in dataframe that contains annotation for the feature to color the language template with.

title

Character vector of length 1, which specifies the title of the plot.

title_position

Character vector of length 1, which specifies the title's position. Possible values are left, center, and right. Default value is left.

annotate_feature

Logical variable that specifies, whether to add feature values on the tile. This especially make sense in case of numeric features. Default value is FALSE.

abbreviation

Logical variable that specifies, whether use abbreviations for languages specified in the package. Default value is TRUE.

hide_languages

Character variable that specifies, which languages should be removed from the template.

rename_languages

This variable maps old language names to their corresponding new names. It can be represented as:

  • either a named vector, where names are the old language names and values are the corresponding new language names.

  • or a data frame with two columns: language (the old language names) and new_language_name (the corresponding new language names).

tile_colors

Character variable that specifies the tile color based on variable levels. Behavior differs depending on the type of the feature variable.

  • For numeric variables, it can be filled with a vector of 2 or 3 colors defining the lower, upper, and middle segments of the palette.

  • For categorical variables, it can be filled with a vector of colors with the length equal to the number of possible values in the feature variable.

  • The variable can also use palettes from the RColorBrewer and viridis packages.

palette_reverse

Logical variable that specifies, whether the colors in palettes from the RColorBrewer and viridis packages should be used in reverse order.

Examples

Run this code
ec_tile_map()

ec_tile_map(ec_languages,
            feature_column = "morning_greetings",
            title = "Morning greetings (Naccarato, Verhees 2021)")

ec_tile_map(ec_languages,
            feature_column = "consonant_inventory_size",
            title = "Consonant inventory size (Moroz 2021)",
            annotate_feature = TRUE)

Run the code above in your browser using DataLab