Teradata Package for R Function Reference | 17.00 - 17.00 - td_xml_to_html_report_valib - 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)
Transform Vantage Analytic Library XML reports to HTML reports.


Several Analytic Algorithms and Scoring functions output columns of XML. This function transforms the XML to HTML, which is easier to view.
Function outputs the HTML in a column of type Teradata XML. You can copy the HTML into a text file, give the text file a name ending in ".html", and view it in a browser.
Alternatively, you can view the HTML in a Jupyter notebook by double-clicking the cell that contains HTML to display it in web view.

  • This function is available in Vantage Analytic Library or later.


td_xml_to_html_report_valib(data, analysis.type, ...)



Required Argument.
Specifies the input data to run statistical tests.
Types: tbl_teradata


Required Argument.
Specifies the class name of the function or a SQL function name whose XML you want the function to translate to HTML.
Function outputs different reports in HTML format depending on the values passed to the argument. Permitted Values:

  • 'decisiontree', 'td_decision_tree_valib'
    Outputs HTML report for:

    • Decision Tree Summary

    • Variables

    • Text Tree

  • 'decisiontreescore', 'td_decision_tree_evaluator_valib'
    Outputs HTML report for:

    • Decision Tree Scoring Summary - Confusion Matrix

  • 'factor', 'td_pca_valib'
    Outputs HTML report for:

    • Factor Analysis Summary

    • Variable Statistics

    • Eigenvalues

    • PCLoadings

    • Variance and Absolute Difference

    • Near Dependency Report

    • Group-by Columns

  • 'factorscore', 'td_pca_evaluator_valib'
    Outputs HTML report for:

    • Factor Analysis Scoring Summary

  • 'linear', 'td_lin_reg_valib'
    Outputs HTML report for:

    • Linear Regression Summary

    • Group-by Columns

    • Near Dependency Report

  • 'logistic', 'td_log_reg_valib'
    Outputs HTML report for:

    • Prediction Success Table

    • Multithreshold Success Table

    • Lift Table

    • Near Dependency Report

    • Group-by Columns

    • Variable Statistics

  • 'logisticscore', 'td_log_reg_evaluator_valib'
    Outputs HTML report for:

    • Prediction Success Table

    • Multithreshold Success Table

    • Lift Table

Types: character


Specifies other arguments supported by the function as described in the 'Other Arguments' section.


Function returns an object of class "td_xml_to_html_report_valib" which is a named list containing object of class "tbl_teradata".
Named list member can be referenced directly with the "$" operator using name: result.

Other Arguments


Optional Argument.
Specifies the clause to filter rows selected for analysis.
For example,
filter = "cust_id > 0"
This parameter is useful only when the function "analysis.type" (which outputs the input table name for the report function) specified its "group.columns" argument and generated multiple XML models.
Multiple XML models in input table name can cause the function to run out of memory. In that case, limit the rows selected for analysis with this argument. Types: character


# Notes:
#   1. To execute Vantage Analytic Library functions, set option 
#      'val.install.location' to the database name where Vantage analytic 
#      library functions are installed.
#   2. Datasets used in these examples can be loaded using Vantage Analytic 
#      Library installer.
#   3. The Statistical Test metadata tables must be loaded into the database 
#      where Analytics Library is installed.

# Set the option 'val.install.location'.
options(val.install.location = "SYSLIB")

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

# Create an object of class "tbl_teradata".
df <- tbl(con, "customer")

# Example: Shows the Near Dependency Report is requested with related 
#          options. Convert the XML reports from the output of this 
#          function to HTML format.
lrobj <- td_log_reg_valib(data=df, 
                          columns=c("age", "years_with_bank", "income"), 

# Print the results.

obj <- td_xml_to_html_report_valib(data=lrobj$model,

# Print the results.