Skip to content

Commit 72db765

Browse files
authored
Improve split docs (#530)
1 parent 0775e0c commit 72db765

File tree

2 files changed

+27
-12
lines changed

2 files changed

+27
-12
lines changed

R/split.R

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
#' Split up a string into pieces
22
#'
33
#' @description
4-
#' These functions differ primarily in their input and output types:
4+
#' This family of functions provides various ways of splitting a string up
5+
#' into pieces. These two functions return a character vector:
56
#'
6-
#' * `str_split()` takes a character vector and returns a list.
7-
#' * `str_split_1()` takes a single string and returns a character vector.
8-
#' * `str_split_fixed()` takes a character vector and returns a matrix.
9-
#' * `str_split_i()` takes a character vector and returns a character
10-
#' vector.
7+
#' * `str_split_1()` takes a single string and splits it into pieces,
8+
#' returning a single character vector.
9+
#' * `str_split_i()` splits each string in a character vector into pieces and
10+
#' extracts the `i`th value, returning a character vector.
11+
#'
12+
#' These two functions return a more complex object:
13+
#'
14+
#' * `str_split()` splits each string in a character vector into a varying
15+
#' number of pieces, returning a list of character vectors.
16+
#' * `str_split_fixed()` splits each string in a character vector into a
17+
#' fixed number of pieces, returning a character matrix.
1118
#'
1219
#' @inheritParams str_detect
1320
#' @inheritParams str_extract

man/str_split.Rd

Lines changed: 14 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)