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 |
location |
List of locations for which the data is exported. Refers to
lists generated in |
keyword |
Object keywords for which data should be exported. Object or
list of objects of type |
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 |
type |
Type of time series for which data should be exported. Element
of type |
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.
-
export_control
andexport_control_global
export data from table *data_controlwith columns location, keyword, date, hits, control. Object of class
"data.frame". Methods are applied based on input *control*. \item
export_objectand
export_object_global export data from table *data_object
with columns location, keyword, date, hits, object. Object of class"data.frame"
. Methods are applied based on input keyword. -
export_score
exports data from table *data_scorewith columns location, keyword, date, score_obs, score_sad, score_trd, control, object. Object of class
c("exp_score", "data.frame"). Methods are applied based on input *keyword*. \item
export_voi exports data from table *data_score
with columns keyword, date, hits, control, filters forlocation == "world"
. Object of classc("exp_voi", "data.frame")
. Methods are applied based on input keyword. -
export_doi
exports data from table *data_doiwith columns keyword, date, type, gini, hhi, entropy, control, object, locations. Object of class
c("exp_doi", "data.frame")'. Methods are applied based on input keyword.
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)