|
1 | 1 | #' Join multiple strings into a single string. |
2 | 2 | #' |
3 | | -#' To understand how \code{str_c} works, you need to imagine that you are |
| 3 | +#' To understand how `str_c` works, you need to imagine that you are |
4 | 4 | #' building up a matrix of strings. Each input argument forms a column, and |
5 | 5 | #' is expanded to the length of the longest argument, using the usual |
6 | | -#' recyling rules. The \code{sep} string is inserted between each column. If |
7 | | -#' collapse is \code{NULL} each row is collapsed into a single string. If |
8 | | -#' non-\code{NULL} that string is inserted at the end of each row, and |
| 6 | +#' recyling rules. The `sep` string is inserted between each column. If |
| 7 | +#' collapse is `NULL` each row is collapsed into a single string. If |
| 8 | +#' non-`NULL` that string is inserted at the end of each row, and |
9 | 9 | #' the entire matrix collapsed to a single string. |
10 | 10 | #' |
11 | 11 | #' @param ... One or more character vectors. Zero length arguments |
|
14 | 14 | #' |
15 | 15 | #' Like most other R functions, missing values are "infectious": whenever |
16 | 16 | #' a missing value is combined with another string the result will always |
17 | | -#' be missing. Use \code{\link{str_replace_na}} to convert \code{NA} to |
18 | | -#' \code{"NA"} |
| 17 | +#' be missing. Use [str_replace_na()] to convert `NA` to |
| 18 | +#' `"NA"` |
19 | 19 | #' @param sep String to insert between input vectors. |
20 | 20 | #' @param collapse Optional string used to combine input vectors into single |
21 | 21 | #' string. |
22 | | -#' @return If \code{collapse = NULL} (the default) a character vector with |
23 | | -#' length equal to the longest input string. If \code{collapse} is |
| 22 | +#' @return If `collapse = NULL` (the default) a character vector with |
| 23 | +#' length equal to the longest input string. If `collapse` is |
24 | 24 | #' non-NULL, a character vector of length 1. |
25 | | -#' @seealso \code{\link{paste}} for equivalent base R functionality, and |
26 | | -#' \code{\link[stringi]{stri_join}} which this function wraps |
| 25 | +#' @seealso [paste()] for equivalent base R functionality, and |
| 26 | +#' [stringi::stri_join()] which this function wraps |
27 | 27 | #' @export str_c |
28 | 28 | #' @examples |
29 | 29 | #' str_c("Letter: ", letters) |
|
42 | 42 | str_c <- function(..., sep = "", collapse = NULL) { |
43 | 43 | stri_c(..., sep = sep, collapse = collapse, ignore_null = TRUE) |
44 | 44 | } |
45 | | - |
46 | | -#' @export |
47 | | -#' @rdname str_c |
48 | | -#' @usage NULL |
49 | | -str_join <- function(..., sep = "", collapse = NULL) { |
50 | | - .Deprecated("str_c") |
51 | | - stri_c(..., sep = sep, collapse = collapse, ignore_null = TRUE) |
52 | | -} |
0 commit comments