get_hub2_table: clessnverse::get_hub2_table

View source: R/dev_t.R

get_hub2_tableR Documentation

clessnverse::get_hub2_table

Description

[Experimental]

get_hub2_table allows the programmer to retrieve a data table from the CLESSN hub2 data warehouse. ** WARNING hub2 will be decommissionned by end of 2022 **

Usage

get_hub2_table(table_name, data_filter = NULL, max_pages = -1, hub_conf)

Arguments

table_name

The name of the table to retrieve from the hub2 warehouse

data_filter

A list containing the filters to apply against the query to retrieve the data. Only observations in the table complyingw with the filter conditions will be returned

max_pages

The number of pages to return. A page is 1000 rows. Tu return the entire table use max_pages = -1

hub_conf

The hub2.0 credentials obtained from the clessnhub::login function

Value

returns a dataframe containing the data warehouse table content

Examples

## Not run: 
 clessnhub::login(
   Sys.getenv("HUB_USERNAME"),
   Sys.getenv("HUB_PASSWORD"),
   Sys.getenv("HUB_URL"))

 # get the journalists intervention in press conference from the
 # 'agoraplus_interventions' table from hub2
 data_filter = list(
   type = "press_conference",
   metadata__location = "CA-QC",
   data__speakerType = "journalist",
   data__eventDate__gte = "2021-01-01",
   data__eventDate__lte = "2022-06-23"
   )

 df <- clessnverse::get_hub2_table(
   table_name = 'agoraplus_interventions',
   data_filter = data_filter,
   max_pages = -1,
   hub_conf = hub_config
   )
 
## End(Not run)


clessn/clessn-verse documentation built on Feb. 18, 2024, 12:42 p.m.