Teradata Package for R Function Reference | 17.00 - 17.00 - loadExampleData - Teradata Package for R

Teradata® Package for R Function Reference

Teradata Package for R
Release Number
July 2021
Last Update
August 2022
Content Type
Programming Reference
Publication ID
English (United States)
Last Update
Loading example data for tdplyr functions


Function to load the example data to a specified table.
This is used only in loading example data for trying examples for the tdplyr functions.

Note: This function

  1. can be used in restricted way in that it can only accept predefined values as can be found only in the examples provided in the function reference guide and the user guide;

  2. creates new table(s) in Vantage. If required, the user must drop them manually;

  3. will skip creation of the table and loading of the data to it if a table with the name provided already exists.


loadExampleData(fileName, ...)



Required Argument.
Specifies the name of the file in inst/extdata directory for data load.
Note: This argument must be used to specify values only as specified in the calls to the function in the example sections of the tdplyr functions.
Types: character


Required Argument.
Specifies the name(s) of the table(s) to create and load the example data to.
Note: The name(s) of table(s) provided with this argument must have corresponding data (CSV) file(s) present in the inst/extdata directory.
Types: character


# Get remote data source connection.
con <- td_get_context()$connection

# Example 1 - Loading single table used in the example for "td_glm_mle".
# Load example data.
loadExampleData("glm_example", "admissions_train")

# Create object of class "tbl_teradata" based on the data loaded to use as input.
admissions_train <- tbl(con, "admissions_train")

# Example 2 - Loading multiple tables used in the examples for "td_glm_predict_mle".
loadExampleData("glmpredict_example", "admissions_test", "housing_test")

# Create objects of class "tbl_teradata" based on the data loaded to use as inputs.
admissions_test <- tbl(con, "admissions_test")
housing_test <- tbl(con, "housing_test")