Skip to content

Commit

Permalink
data_rename: mention use of unlist() for named lists
Browse files Browse the repository at this point in the history
  • Loading branch information
etiennebacher committed Jan 3, 2025
1 parent 416c1b0 commit 2b5d0fa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions R/data_rename.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,16 @@
#'
#' @details
#' `select` can also be a named character vector. In this case, the names are
#' used to rename the columns in the output data frame. See 'Examples'.
#' used to rename the columns in the output data frame. If you have a named
#' list, use `unlist()` to convert it to a named vector. See 'Examples'.
#'
#' @return A modified data frame.
#'
#' @examples
#' # Rename columns
#' head(data_rename(iris, "Sepal.Length", "length"))
#'
#' # use named vector to rename
#' # Use named vector to rename
#' head(data_rename(iris, c(length = "Sepal.Length", width = "Sepal.Width")))
#'
#' # Change all
Expand Down
5 changes: 3 additions & 2 deletions man/data_rename.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2b5d0fa

Please sign in to comment.