StrApply
Description
td_str_apply_sqle()
function applies a specified string operator to the specified input tbl_teradata columns.
Usage
td_str_apply_sqle (
data = NULL,
target.columns = NULL,
output.columns = NULL,
accumulate = NULL,
string.operation = NULL,
operating.side = NULL,
in.place = TRUE,
string = NULL,
escape.string = NULL,
is.case.specific = TRUE,
ignore.trailing.blank = FALSE,
string.length = NULL,
start.index = NULL,
...
)
Arguments
data |
Required Argument. |
target.columns |
Required Argument. |
output.columns |
Optional Argument. |
accumulate |
Optional Argument. |
string.operation |
Required Argument.
Types: character |
operating.side |
Optional Argument. |
in.place |
Optional Argument. |
string |
Optional Argument. |
escape.string |
Optional Argument. |
is.case.specific |
Optional Argument. |
ignore.trailing.blank |
Optional Argument. |
string.length |
Optional Argument. |
start.index |
Optional Argument. |
... |
Specifies the generic keyword arguments SQLE functions accept. volatile: Function allows the user to partition, hash, order or local order the input data. These generic arguments are available for each argument that accepts tbl_teradata as input and can be accessed as:
Note: |
Value
Function returns an object of class "td_str_apply_sqle"
which is a named list containing object of class "tbl_teradata".
Named list member(s) can be referenced directly with the "$" operator
using the name(s):result
Examples
# Get the current context/connection.
con <- td_get_context()$connection
# Load the example data.
loadExampleData("tdplyr_example", "titanic")
# Create tbl_teradata object.
titanic_data <- tbl(con, "titanic")
# Check the list of available analytic functions.
display_analytic_functions()
# Example 1: Apply 'TOUPPER' string operator to the
# specified input "name" columns.
obj <- td_str_apply_sqle(data=titanic_data,
target.columns='name',
string.operation='TOUPPER',
in.place=FALSE)
# Print the result.
print(obj$result)
# Example 2: Apply td_str_apply_sqle using all the arguments.
obj <- td_str_apply_sqle(
data=titanic_data,
data.partition.column='age',
data.order.column='age',
target.columns='name',
accumulate='passenger',
output.columns='str_op_output',
string.operation='TOUPPER',
in.place=FALSE,
persist=TRUE)
# Print the result.
print(obj$result)