Teradata Package for R Function Reference | 17.00 - 17.00 - td_values_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)
Last Update
Descriptive Statistics Function: Values


Use Values analysis as the first type of analysis performed on unknown data. Values analysis determines the nature and quality of the data. For example, whether the data is categorical or continuously numeric, how many null values it contains, and so on.

A Values analysis provides a count of rows, rows with non-null values, rows with null values, rows with value 0, rows with a positive value, rows with a negative value, and the number of rows containing blanks in the given column. By default, unique values are counted, but this calculation can be inhibited for performance reasons if desired.

For a column of non-numeric type, the zero, positive, and negative counts are always zero (for example, 000 is not counted as 0). A Values analysis can be performed on columns of any data type, though the measures displayed vary according to column type.


td_values_valib(data, columns, ...)



Required Argument.
Specifies the input data to perform Values analysis.
Types: tbl_teradata


Required Argument.
Specifies the name(s) of the column(s) to analyze. Occasionally, it can also accept permitted strings to specify all columns, or all numeric columns, or all character columns.
Permitted Values:

  1. Name(s) of the column(s) in "data".

  2. Pre-defined strings:

    1. 'all' - all columns

    2. 'allnumeric' - all numeric columns

    3. 'allcharacter' - all numeric and date columns

Types: character OR vector of Strings (character)


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


Function returns an object of class "td_values_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 name(s) of the column(s) to exclude from the analysis, if a column specifier such as 'all', 'allnumeric', 'allcharacter' is used in the "columns" argument.
Types: character OR vector of Strings (character)


Optional Argument.
Specifies the name(s) of column(s) to perform separate analysis for each group.
Types: character OR vector of Strings (character)


Optional Argument.
Specifies whether to select unique values count for each selected column.
Default Value: FALSE
Types: logical


Optional Argument.
Specifies the clause to filter rows selected for analysis within Values.
For example,
filter = "cust_id > 0"
Types: character


# Notes:
#   1. To execute Vantage Analytic Library functions, set options '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.

# 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 1: Perform Values analysis using default values on 'income' and
#            'marital_status' columns.
obj <- td_values_valib(data=df, columns=c("income", "marital_status"))

# Print the results.

# Example 2: Perform Values analysis on 'income' column with values grouped by
#            'gender' and only for rows with income greater than 0.
obj <- td_values_valib(data=df, columns="income", group.columns="gender", filter="income > 0")

# Print the results.