get_warehouse_table: clessnverse::get_warehouse_table

View source: R/dev_t.R

get_warehouse_tableR Documentation

clessnverse::get_warehouse_table

Description

[Experimental]

get_warehouse_table allows the programmer to retrieve a data table from the CLESSN data warehouse named hublot.

Usage

get_warehouse_table(table_name, credentials, data_filter = list(), nbrows = 0)

Arguments

table_name

The name of the table to retrieve from the warehouse without the 'chlub_tables_warehouse' prefix

credentials

The hublot credentials obtained from the hublot::get_credentials function

data_filter

a filter on the data to be selected in the query

nbrows

Optional argument If nbrows is greater than 0, the dataframe returned will be limited to nbrows observations. This is particularly useful when trying to see if there are records in a table and what how structured they are. If nbrows is omitted, then all rows of the table are returned

Value

returns a dataframe containing the data warehouse table content with the document.id and creation & update time stamps

Examples

 ## Not run: 
 # connect to hublot
 credentials <- hublot::get_credentials(
   Sys.getenv("HUB3_URL"),
   Sys.getenv("HUB3_USERNAME"),
   Sys.getenv("HUB3_PASSWORD")
   )

 # gets the entire warehouse table 'people'
 clessnverse::get_warehouse_table('people', credentials)

 # gets the first 10 rows of the 'political_parties_press_releases' table
 clessnverse::get_warehouse_table(
   table_name = 'political_parties_press_releases',
   data_filter = list(),
   credentials = credentials,
   nbrows=10
   )
 
## End(Not run)


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