plot_nameage: plot_nameage

Description Usage Arguments Value Examples

Description

Plot the distribution of the age for a person based on name.

Usage

1
2
3
plot_nameage(names, base_year = 2015, age_range, type = c("age", "year"),
  alive_geom = c("area", "bar"), facet_scales = c("free_y", "free_x",
  "free", "fixed"), fill_color = "#008b8b", line_color = "black")

Arguments

names

First names as a character vector. Names are case insensitive.

base_year

Year that the age is calculated as of.

age_range

Limit the range of possible ages that the name could come from. This could be useful if you know, for example, that the name is of an adult. If missing, all ages will be considered.

type

Whether to plot age or year on the x-axis.

alive_geom

Choice of whether to plot as an area or bar chart.

facet_scales

Passed to the scales argument of facet_wrap.

fill_color

The color that the number alive gets filled in as.

line_color

The color that the number born is colored.

Value

A ggplot2 object. It will have one facet per unique name.

Examples

1
2
plot_nameage(c("Anna", "Joseph"), type = "age")
plot_nameage(c("Anna", "Joseph"), type = "year")

andland/nameage documentation built on May 7, 2019, 8:57 p.m.