Skip to content

Commit 8d98911

Browse files
committed
Add vec_init() example with lists for tidyverse/dplyr#7076
1 parent cf0e08b commit 8d98911

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

R/slice.R

+5
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,12 @@ vec_index <- function(x, i, ...) {
235235
#' @examples
236236
#' vec_init(1:10, 3)
237237
#' vec_init(Sys.Date(), 5)
238+
#'
239+
#' # The "missing" value for a data frame is a row that is entirely missing
238240
#' vec_init(mtcars, 2)
241+
#'
242+
#' # The "missing" value for a list is `NULL`
243+
#' vec_init(list(), 3)
239244
vec_init <- function(x, n = 1L) {
240245
.Call(ffi_init, x, n, environment())
241246
}

man/vec_init.Rd

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)