Teradata R Package Function Reference - 16.20 - CCMPrepare - Teradata R Package

Teradata® R Package Function Reference

prodname
Teradata R Package
vrm_release
16.20
created_date
February 2020
category
Programming Reference
featnum
B700-4007-098K

Description

The CCMPrepare (td_ccm_prepare_mle) function prepares an input table for the CCM function by adding a partition column, "aster_ccm_id", and partitioning the data. Using the CCMPrepare function is optional. However, partitioning the data, instead of having all sequences on one vworker, may increase the speed of the CCM (td_ccm_mle) function for large data sets consisting of multiple sequences.

Usage

  td_ccm_prepare_mle (
      data = NULL,
      data.partition.column = NULL
  )

Arguments

data

Required Argument.
Specifies the tbl_teradata containing the input data.

data.partition.column

Required Argument.
Specifies the Partition By columns for "data".
Values to this argument can be provided as vector, if multiple columns are used for ordering.

Value

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

Examples

    # Get the current context/connection
    con <- td_get_context()$connection
    
    # Load example data.
    loadExampleData("ccmprepare_example", "ccmprepare_input")
    
    # The ccmprepare_input table, ccmprepare_input, is a collection of nine 
    # time series consisting of 10 values for each of three variables 
    # (expenditure, income, and investment)
    ccmprepare_input <- tbl(con, "ccmprepare_input")
    
    # Prepare the given input for CCM
    td_ccm_prepare_out <- td_ccm_prepare_mle(data = ccmprepare_input,
                                         data.partition.column = "id"
                                        )