Github user sun-rui commented on a diff in the pull request:

    https://github.com/apache/spark/pull/8962#discussion_r41087208
  
    --- Diff: R/pkg/R/DataFrame.R ---
    @@ -1873,3 +1872,29 @@ setMethod("as.data.frame",
                 collect(x)
               }
     )
    +
    +#' freqItems
    +#'
    +#' Finding frequent items for columns, possibly with false positives.
    +#' Using the frequent element count algorithm described in
    +#' \url{http://dx.doi.org/10.1145/762471.762473}, proposed by Karp, 
Schenker, and Papadimitriou.
    +#' 
    +#' @param col A list of columns to search frequent items in.
    +#' @param support (Optional) The minimum frequency for an item to be 
considered `frequent`. 
    +#'                Should be greater than 1e-4. Default support = 0.01.
    +#' @return a local R data.frame with the frequent items in each column
    +#'
    +#' @rdname freqItems
    +#' @name freqItems
    +#' @export
    +#' @examples
    +#' \dontrun{
    +#' df <- jsonFile(sqlCtx, "/path/to/file.json")
    +#' fi = freqItems(df, "title", "gender")
    +#' }
    +setMethod("freqItems", signature(x = "DataFrame"),
    +          function(x, ..., support) {
    --- End diff --
    
    I think using vector for cols is more R stylish. 
    signature(x = "DataFrame", cols = "character", support = "numeric"),
    function(x, cols, support = 0.01) {


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to