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

    https://github.com/apache/spark/pull/18366#discussion_r123758738
  
    --- Diff: R/pkg/R/functions.R ---
    @@ -833,21 +838,21 @@ setMethod("hour",
                 column(jc)
               })
     
    -#' initcap
    -#'
    -#' Returns a new string column by converting the first letter of each word 
to uppercase.
    -#' Words are delimited by whitespace.
    -#'
    -#' For example, "hello world" will become "Hello World".
    -#'
    -#' @param x Column to compute on.
    +#' @details
    +#' \code{initcap}: Returns a new string column by converting the first 
letter of
    +#' each word to uppercase. Words are delimited by whitespace. For example, 
"hello world"
    +#' will become "Hello World".
     #'
    -#' @rdname initcap
    -#' @name initcap
    -#' @family string functions
    -#' @aliases initcap,Column-method
    +#' @rdname column_string_functions
    +#' @aliases initcap initcap,Column-method
     #' @export
    -#' @examples \dontrun{initcap(df$c)}
    +#' @examples
    +#'
    +#' \dontrun{
    +#' tmp <- mutate(df, SexLower = lower(df$Sex), AgeUpper = upper(df$age))
    +#' head(tmp)
    +#' tmp2 <- mutate(tmp, s1 = initcap(tmp$SexLower), s2 = reverse(df$Sex))
    --- End diff --
    
    Great catch. Thanks. Added an example on multiple words: 
`initcap(concat_ws(" ", lower(df$sex), lower(df$age)))`


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