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

    https://github.com/apache/spark/pull/18458#discussion_r124706890
  
    --- Diff: R/pkg/R/functions.R ---
    @@ -132,6 +132,35 @@ NULL
     #' df <- createDataFrame(as.data.frame(Titanic, stringsAsFactors = FALSE))}
     NULL
     
    +#' Collection functions for Column operations
    +#'
    +#' Collection functions defined for \code{Column}.
    +#'
    +#' @param x Column to compute on. Note the difference in the following 
methods:
    +#'          \itemize{
    +#'          \item \code{to_json}: it is the column containing the struct 
or array of the structs.
    +#'          \item \code{from_json}: it is the column containing the JSON 
string.
    +#'          }
    +#' @param ... additional argument(s). In \code{to_json} and 
\code{from_json}, this contains
    +#'            additional named properties to control how it is converted, 
accepts the same
    +#'            options as the JSON data source.
    +#' @name column_collection_functions
    +#' @rdname column_collection_functions
    +#' @family collection functions
    +#' @examples
    +#' \dontrun{
    +#' # Dataframe used throughout this doc
    +#' df <- createDataFrame(cbind(model = rownames(mtcars), mtcars))
    +#' df <- createDataFrame(cbind(model = rownames(mtcars), mtcars))
    +#' tmp <- mutate(df, v1 = create_array(df$mpg, df$cyl, df$hp))
    +#' head(select(tmp, array_contains(tmp$v1, 21), size(tmp$v1)))
    +#' tmp2 <- mutate(tmp, v2 = explode(tmp$v1))
    +#' head(tmp2)
    +#' head(select(tmp, posexplode(tmp$v1)))
    +#' head(select(tmp, sort_array(tmp$v1)))
    +#' head(select(tmp, sort_array(tmp$v1, FALSE)))}
    --- End diff --
    
    nit, let's improve this? I think in sort_array we could be more clear, eg. 
`sort_array(tmp$v1, asc = FALSE)`


---
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