Description
The SimpleMovAvg function computes the simple moving average of points in a series.
Usage
td_simple_mov_avg_mle (
data = NULL,
target.columns = NULL,
include.first = FALSE,
window.size = 10,
data.sequence.column = NULL,
data.partition.column = NULL,
data.order.column = NULL
)
Arguments
data |
Required Argument. |
data.partition.column |
Required Argument. |
data.order.column |
Required Argument. |
target.columns |
Optional Argument. |
include.first |
Optional Argument. |
window.size |
Optional Argument. |
data.sequence.column |
Optional Argument. |
Value
Function returns an object of class "td_simple_mov_avg_mle" which is a
named list containing object of class "tbl_teradata".
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("simplemovavg_example", "ibm_stock")
# Create object(s) of class "tbl_teradata".
ibm_stock <- tbl(con, "ibm_stock")
# Compute the simple moving average for "stockprice".
# This also includes the first 9 rows with moving average NA.
td_simple_mov_avg_out <- td_simple_mov_avg_mle(data = ibm_stock,
data.partition.column = "name",
data.order.column = "period",
target.columns = "stockprice",
include.first = TRUE,
window.size = 10
)