export_control {globaltrends}R Documentation

Export data from database table

Description

The function allows to export data from database tables. In combination with various write functions in R, the functions allow exports from the database to local files.

Usage

export_control(control = NULL, location = NULL)

export_control_global(control = NULL)

export_object(keyword = NULL, object = NULL, control = NULL, location = NULL)

export_object_global(keyword = NULL, object = NULL, control = NULL)

export_score(keyword = NULL, object = NULL, control = NULL, location = NULL)

export_voi(keyword = NULL, object = NULL, control = NULL)

export_doi(
  keyword = NULL,
  object = NULL,
  control = NULL,
  locations = NULL,
  type = c("obs", "sad", "trd")
)

Arguments

control

Control batch number for which data should be exported. Only for export_control and export_control_global, input is also possible as list.

location

List of locations for which the data is exported. Refers to lists generated in start_db or character objects in these lists. Only for export_control, export_object, or export_score.

keyword

Object keywords for which data should be exported. Object or list of objects of type character.

object

Object batch number for which data should be exported.

locations

List of locations for which the data is exported. Refers to names of lists generated in start_db as an object of type character. Only for export_doi.

type

Type of time series for which data should be exported. Element of type character. Relevant only for export_global and export_doi. Takes one of the following values: obs - observed search scores, sad - seasonally adjusted search scores, trd - trend only search scores.

Details

Exports can be filtered by keyword, object, control, location, locations, or type. Not all filters are applicable for all functions. When filter keyword and object are used together, keyword overrules object. When supplying NULL as input, no filter is applied to the variable.

Value

The functions export and filter the respective database tables.

See Also

Examples

## Not run: 
export_control(control = 2)

export_object(
  keyword = "manchester united",
  locations = countries
)

export_object(
  keyword = c("manchester united", "real madrid")
)

export_object(
  keyword = list("manchester united", "real madrid")
)

export_score(
  object = 3,
  control = 1,
  location = us_states
) %>%
  readr::write_csv("data_score.csv")

export_doi(
  keyword = "manchester united",
  control = 2,
  type = "sad",
  locations = "us_states"
) %>%
  writexl::write_xlsx("data_doi.xlsx")

## End(Not run)


[Package globaltrends version 0.0.14 Index]