add_locations {globaltrends}R Documentation

Add sets of locations

Description

The function adds a new set of locations for downloads and computations to the database. The location set serves as input for all download and computation functions.

Usage

add_locations(locations, type, export = TRUE)

Arguments

locations

Locations that should be added as set of locations. Vector of type character.

type

Name of the location set that should be added. Object of type character of length 1.

export

Indicator whether the new location set should be directly exported to the package environment gt.env. Object of type logical, defaults to TRUE.

Details

Location sets control the locations for which data is downloaded or to which computations are applied. By adding new location sets, the default sets countries and us_states can be expanded by additional sets. Thereby, users can compute DOI within a region (e.g., adding EU countries as a set) or single countries (e.g., adding regions of France as a set). Download and computation functions check whether data for a location already exists. Therefore, data will not be duplicated when location data already exists from another set.

Value

Message that the location set has been created successfully. Location data is written to table data_locations.

Warning

Unfortunately, the Google Trends API cannot handle the location "NA - Namibia". Therefore, the location will be dropped automatically.

Examples

## Not run: 
add_locations(locations = c("AT", "CH", "DE"), type = "DACH")

## End(Not run)


[Package globaltrends version 0.0.14 Index]