Histogram
Description
Function calculates the frequency distribution of a data set using any of these methods:
Sturges
Scott
Variable-width
Equal-width
Usage
td_histogram_sqle (
data = NULL,
object = NULL,
target.columns = NULL,
method.type = NULL,
nbins = 1,
inclusion = "LEFT",
...
)
Arguments
data |
Required Argument. |
object |
Optional Argument. |
target.columns |
Required Argument. |
method.type |
Required Argument.
Types: character |
nbins |
Optional Argument, Required when "method.type" is 'Variable-Width' and 'Equal-Width'. |
inclusion |
Optional Argument. |
... |
Specifies the generic keyword arguments SQLE functions accept. persist: 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_histogram_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", "min_max_titanic")
# Create tbl_teradata object.
titanic_data <- tbl(con, "titanic")
# Create tbl_teradata object for minimum and maximum value of bin
# "Young age", "Middle Age" and, "Old Age".
min_max_object <- tbl(con, "min_max_titanic")
# Check the list of available analytic functions.
display_analytic_functions()
# Example 1: Get the frequency distribution of a data set using 'sturges'
# method type for the values in column 'age'.
obj <- td_histogram_sqle(data=titanic_data,
target.columns="age",
method.type="Sturges")
# Print the result.
print(obj$result)
# Example 2: Get the frequency distribution of a data set using 'variable-width'
# method type for the values in column 'age' with 3 number of bins.
obj <- td_histogram_sqle(data=titanic_data,
object=min_max_object,
target.columns="age",
method.type="variable-width",
nbins=3)
# Print the result.
print(obj$result)