geocard: Create a geo card

Description Usage Arguments Examples

View source: R/geocard.R

Description

Create a geo card

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
geocard(
  data,
  card_name,
  cog = NULL,
  population = NA,
  ref_source = NULL,
  y_domain = NULL,
  y_log_domain = NULL,
  case_fatality_max = 25,
  max_date = NULL,
  min_date = NULL,
  img_url = NULL,
  feed_url = NULL,
  twitter_account = NULL,
  facebook_account = NULL,
  width = NULL,
  height = NULL,
  element_id = NULL
)

Arguments

data

A long-format data frame with columns: "date", "cases", "deaths", "source".

card_name

Name to display at the top of the geocard.

cog

A data frame containing "cognostics" about the the geocard. If not supplied, it will be calculated using get_cogs.

population

Optional population of the geographic entity being plotted (used to populate the "per 100k population" statistics in the card).

ref_source

Which source should be used as the reference (default) source? The reference source is the source with which other sources will be compared. It should match one of the values in the "source" column of the provided data.

y_domain

An optional custom y domain (if not specified, will be from 0 to the range of the data).

y_log_domain

An optional custom y domain when viewing on the log scale.

case_fatality_max

A cutoff for the y axis when showing case fatality percentage - useful when some entities have outlying values.

max_date

An optional maximum date to show in the plot. Defaults to latest.

min_date

An optional minimum date to show in the plot. Defaults to 8 weeks prior to max_date.

img_url

An optional URL to use to display an image in the header bar of the geocard, which can be useful as a quick visual reference cue when scanning multiple geocards at once.

feed_url

An optional vector of URLS pointing to RSS feeds from the entity's source.

twitter_account

An optional vector of URLS pointing to twitter feeds from the entity's source.

facebook_account

An optional vector of URLS pointing to Facebook from the entity's source.

width

Optional card height in pixels

height

Optional card width in pixels

element_id

Optional htmlwidget element ID.

Examples

1
2
3
4
5
6
7
geocard(
  wa_cases, 
  card_name = "Washington", 
  population = 7549403, 
  ref_source = "NYT", 
  img_url = "https://raw.githubusercontent.com/hafen/us-locator-maps/master/thumbs/admin1/US/53.png" 
)

WorldHealthOrganization/geocard documentation built on Oct. 7, 2020, 5:44 a.m.