Returns instability data for given locations

instability_api_locations(
  location_ids = c("US", "IS", "TU"),
  random_locations = NULL,
  variable_names = c("instability", "conflict", "tone", "protest", "artvolnorm"),
  days_moving_average = NA,
  time_periods = "daily",
  use_multi_locations = F,
  return_wide = T,
  visualize = F,
  nest_data = F,
  return_message = T
)

Arguments

location_ids

Specify the location IDs

random_locations

Number of random location IDs to add

variable_names

Specify variables they can include:

  • instability

  • conflict

  • protest

  • tone

  • artvolnorm: Relative mentions

days_moving_average

Specify day moving average, NA is unsmoothed

time_periods

Specified time period

  • daily

  • 15min

use_multi_locations

if TRUE returns all cities in a select country

return_wide

if TRUE returns a wide data frame

visualize

if `TRUE` returns a ggplot2 visualization

nest_data

if TRUE returns a nested data frame

return_message

if TRUE returns a location

Value

if visualize a ggplot visualization else a tibble

Examples

instability_api_locations(location_ids = c('US', 'IS', "TU"), random_locations = NULL, variable_names = c('instability', 'conflict', 'tone', 'protest', 'artvolnorm'), visualization = T, days_moving_average = NA, time_periods = 'daily', use_multi_locations = F, return_wide = T, nest_data = F, return_message = T)