Teradata R Package Function Reference | 17.00 - 17.00 - PathGenerator - Teradata R Package

Teradata® R Package Function Reference

prodname
Teradata R Package
vrm_release
17.00
created_date
September 2020
category
Programming Reference
featnum
B700-4007-090K

Description

The PathGenerator function 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 "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)

seq.column

Required Argument.
Specifies the name of the input tbl_teradata column that contains the paths.
Types: 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 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("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"
                                               )