get_mart_table: clessnverse::get_mart_table

View source: R/dev_t.R

get_mart_tableR Documentation

clessnverse::get_mart_table

Description

[Experimental]

get_mart_table allows the programmer to retrieve a data table from a CLESSN data mart.

Usage

get_mart_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_mart' prefix

credentials

The hublot credentials obtained from the hublot::

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 with a JSON attribute as well as a 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 datamart political_parties_press_releases_freq
 datamart  <- clessnverse::get_mart_table(
   table_name = 'political_parties_press_releases_freq',
   data_filter = list(),
   credentials = credentials)

 # gets the first 10 rows of the warehouse table 'political_parties_press_releases_freq'
 datamart  <- clessnverse::get_mart_table(
   table_name = 'political_parties_press_releases_freq',
   data_filter = list(),
   credentials = credentials,
   nbrows=10)
 
## End(Not run)


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