Skip to content

Commit

Permalink
Merge pull request #1012 from tidyverse/docs-978-matrix
Browse files Browse the repository at this point in the history
- Add more examples for data frame and matrix columns (#978, #1012).
  • Loading branch information
krlmlr committed Feb 3, 2022
2 parents 07730bc + b496adb commit 281c74d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
13 changes: 8 additions & 5 deletions R/tibble.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#' refer to columns created earlier in the call. Only columns of length one
#' are recycled.
#' * If a column evaluates to a data frame or tibble, it is nested or spliced.
#' If it evaluates to a matrix or a array, it remains a matrix or array,
#' respectively.
#' See examples.
#'
#' @param ... <[`dynamic-dots`][rlang::dyn-dots]>
Expand Down Expand Up @@ -124,18 +126,19 @@
#' tibble(
#' a = 1:3,
#' b = diag(3),
#' c = cor(trees)
#' c = cor(trees),
#' d = Titanic[1:3, , , ]
#' )
#'
#' # data can not contain POSIXlt columns, or tibbles or matrices
#' # with incompatible number of rows:
#' try(tibble(y = strptime("2000/01/01", "%x")))
#' # Data can not contain tibbles or matrices with incompatible number of rows:
#' try(tibble(a = 1:3, b = tibble(c = 4:7)))
#'
#' # Use := to create columns with names that start with a dot:
#' tibble(.dotted = 3)
#' tibble(.dotted := 3)
#'
#' # This also works, but might break in the future:
#' tibble(.dotted = 3)
#'
#' # You can unquote an expression:
#' x <- 3
#' tibble(x = 1, y = x)
Expand Down
13 changes: 8 additions & 5 deletions man/tibble.Rd

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

0 comments on commit 281c74d

Please sign in to comment.