Description
The Pack td_pack_sqle
function packs data from multiple input columns into a
single column. The packed column has a virtual column for each input
column. By default, virtual columns are separated by commas and each
virtual column value is labeled with its column name.
Note: This function is only available when tdplyr is connected to Vantage 1.1
or later versions.
Usage
td_pack_sqle ( data = NULL, input.columns = NULL, output.column = NULL, delimiter = ",", include.column.name = TRUE, data.order.column = NULL )
Arguments
data |
Required Argument. |
data.order.column |
Optional Argument. |
input.columns |
Optional Argument. |
output.column |
Required Argument. |
delimiter |
Optional Argument. |
include.column.name |
Optional Argument. |
Value
Function returns an object of class "td_pack_sqle" 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("pack_example", "ville_temperature") # Create remote tibble objects. # The input table, ville_temperature, contains temperature readings for the cities # Nashville and Knoxville, in the state of Tennessee. ville_temperature <- tbl(con, "ville_temperature") # Example 1 - td_pack_out1 <- td_pack_sqle(data = ville_temperature, input.columns = c("city", "state", "period", "temp_f"), output.column = "packed_data", delimiter = ",", include.column.name = TRUE ) # Example 2 - td_pack_out2 <- td_pack_sqle(data = ville_temperature, input.columns = c("city", "state", "period", "temp_f"), output.column = "packed_data", delimiter = "|", include.column.name = FALSE )