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

Teradata® R Package Function Reference

Product
Teradata R Package
Release Number
16.20
Published
February 2020
Language
English (United States)
Last Update
2020-02-28
dita:id
B700-4007
lifecycle
previous
Product Category
Teradata Vantage

Description

The PathGenerator function (td_path_generator_mle) takes a set of paths and outputs the sequence and all possible subsequences, which can be input to the function PathSummarizer (td_path_summarizer_mle).

Usage

  td_path_generator_mle (
      data = NULL,
      seq.column = NULL,
      delimiter = ",",
      data.sequence.column = NULL,
      data.order.column = NULL
  )

Arguments

data

Required Argument.
Specifies the name of the tbl_teradata containing the input data.

data.order.column

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

seq.column

Required Argument.
Specifies the name of the columns in the input argument "data" that contains the paths.
Types: character OR vector of Strings (character)

delimiter

Optional Argument. Specifies the single-character delimiter that separates symbols in the path string.
Note: Do not use any of the following characters as delimiter (they cause the function to fail): Asterisk (*), Plus (+), Left parenthesis ((), Right parenthesis ()), Single quotation mark ('), Escaped single quotation mark (\'), Backslash (\).
Default Value: ","
Types: character

data.sequence.column

Optional Argument.
Specifies the vector of column(s) that uniquely identifies each row of the input argument "data". The argument is used to ensure deterministic results for functions which produce results that vary from run to run.
Types: character OR vector of Strings (character)

Value

Function returns an object of class "td_path_generator_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("pathgenerator_example", "clickstream1")
    
    # Create remote tibble objects.
    # The table contains clickstream data, where the "path" column
    # contains symbols for the pages that the customer clicked
    clickstream1 <- tbl(con, "clickstream1")
    
    # Generate path sequences and count for the given clickstream data
    td_path_generator_out <- td_path_generator_mle(data = clickstream1,
                                               seq.column = "path"
                                               )