Github user shivaram commented on a diff in the pull request:

    https://github.com/apache/spark/pull/9193#discussion_r42886920
  
    --- Diff: R/pkg/R/functions.R ---
    @@ -2008,3 +2008,101 @@ setMethod("ifelse",
                                     "otherwise", no)
                   column(jc)
               })
    +
    +###################### Window functions######################
    +
    +#' cumeDist
    +#'
    +#' Window function: returns the cumulative distribution of values within a 
window partition,
    +#' i.e. the fraction of rows that are below the current row.
    +#' 
    +#'   N = total number of rows in the partition
    +#'   cumeDist(x) = number of values before (and including) x / N
    +#'   
    +#' This is equivalent to the CUME_DIST function in SQL.
    +#'
    +#' @rdname cumeDist
    +#' @name cumeDist
    +#' @family window_funcs
    +#' @export
    +#' @examples \dontrun{cumeDist()}
    +setMethod("cumeDist",
    +          signature(x = "missing"),
    +          function() {
    +            jc <- callJStatic("org.apache.spark.sql.functions", "cumeDist")
    +            column(jc)
    +          })
    +
    +#' lag
    +#'
    +#' Window function: returns the value that is `offset` rows before the 
current row, and
    +#' `defaultValue` if there is less than `offset` rows before the current 
row. For example,
    +#' an `offset` of one will return the previous row at any given point in 
the window partition.
    +#' 
    +#' This is equivalent to the LAG function in SQL.
    +#'
    +#' @rdname lag
    +#' @name lag
    +#' @family window_funcs
    +#' @export
    +#' @examples \dontrun{lag(df$c)}
    +setMethod("lag",
    --- End diff --
    
    There is a method called `lag` in base R that this would conflict with. 
Could we try to use the same argument names as that function ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to