R/td.mode.R

Defines functions td.mode

Documented in td.mode

td.mode <- function(tdf, col) {
    if (!is.td.data.frame(tdf)) 
        stop("'tdf' is not a td data frame")
    if (!length(names(tdf))) 
        stop("td.data.frame contains no columns")
    if (missing(col) && length(tdf) == 1L) 
        col <- names(tdf)[1]
    query <- .td.genmode(tdf, col)
    df <- try(tdQuery(query))
    if (is.null(class(df))) 
        stop("Error retrieving mode values from table.")
    return(df)
}
 
nonsleepr/teradataR documentation built on May 23, 2019, 9:32 p.m.