simulate_data: Simulate map data

Description Usage Arguments Value Examples

View source: R/simulate_data.R

Description

This function simulates data for a map of the European Union (EU) made by eumaps::make_map(). The data is drawn from a uniform distribution. It creates a tibble. You can pass the column member_state to the member_states argument of create_palette() and the column value to the values argument of create_palette().

Usage

1

Arguments

date

String or date. Optional. If not NULL, data will only be simulated for countries that were member states on this date. If not NULL, today's date is used, and data will only be simulated for current member states. The default value is NULL.

min

Numeric. Required, has a default value. The minimum value to use for the uniform distribution. The default value is 0.

max

Numeric. Required, has a default value. The maximum value to use for the uniform distribution. The default value is 1.

missing

String. Optional. A vector of member states names. The data for these member states will be coded as NA. This is option is useful for testing out color palettes. The default value is NULL.

Value

This function returns a tibble with 3 columns: member_state_id, member_state, and value.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# using the default values
data <- simulate_data()

# using all options
data <- simulate_data(
  date = "2015-01-01",
  min = 0,
  max = 1,
  missing = c("France", "Germany")
)

jfjelstul/eumaps documentation built on Jan. 8, 2022, 1:17 a.m.