Teradata Package for R Function Reference | 17.00 - CCMPrepare - Teradata Package for R - Look here for syntax, methods and examples for the functions included in the Teradata Package for R.

Teradata® Package for R Function Reference

Product
Teradata Package for R
Release Number
17.00
Published
July 2021
Language
English (United States)
Last Update
2023-08-08
dita:id
B700-4007
NMT
no
Product Category
Teradata Vantage
CCMPrepare

Description

The CCMPrepare function prepares an input tbl_teradata for the CCM function by adding a partition column, "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 = "1",
      data.order.column = NULL
  )

Arguments

data

Required Argument.
Specifies the tbl_teradata containing the input data.

data.partition.column

Optional Argument
Specifies Partition By columns for "data".
Values to this argument can be provided as a vector, if multiple columns are used for partition.
Default Value: "1"
Types: character OR vector of Strings (character)

data.order.column

Optional Argument.
Specifies Order By columns for "data".
Values to this argument can be provided as a vector, if multiple columns are used for ordering.
Types: character OR vector of Strings (character)

Value

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

Examples

  
    # Get the current context/connection
    con <- td_get_context()$connection
    
    # Load example data.
    loadExampleData("ccmprepare_example", "ccmprepare_input")

    # The ccmprepare_input tbl_teradata 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"
                                        )