owid_grapher: Create an Our World in Data style graph.

Description Usage Arguments Value Examples

View source: R/owid_grapher.R

Description

Use any dataframe to create your own owid style graphs. The function currently requires an internet connection to work. **Warning:** This function is in very early stages of development, may not be fully functional and may undergo major changes.

Usage

1
owid_grapher(data, x, y, entity)

Arguments

data

The dataframe to be used in the graph

x

The column to be displayed on the x axis. Currently only a column of years is supported.

y

The column to be displayed on the y axis.

entity

The column containing the entities included in the dataset, e.g. the country column.

Value

If executed from within an R script then the graph will be displayed within the viewer. If executed from within an RMarkdown file the graph will be displayed within the output document (only if the output is an html document).

Examples

1
2
3
4
5
6
7
8
9
library(dplyr)

## Not run: 
owid_grapher(human_rights, x = year, y = score, entity = entity) %>%
  grapher_line() %>%
  grapher_map(palette = "RdYlGn") %>%
  grapher_labels(title = "Human Rights Score")

## End(Not run)

piersyork/owidGrapher documentation built on Dec. 22, 2021, 8:42 a.m.