1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dup.R
\name{str_dup}
\alias{str_dup}
\title{Duplicate a string}
\usage{
str_dup(string, times)
}
\arguments{
\item{string}{Input vector. Either a character vector, or something
coercible to one.}
\item{times}{Number of times to duplicate each string.}
}
\value{
A character vector the same length as \code{string}/\code{times}.
}
\description{
\code{str_dup()} duplicates the characters within a string, e.g.
\code{str_dup("xy", 3)} returns \code{"xyxyxy"}.
}
\examples{
fruit <- c("apple", "pear", "banana")
str_dup(fruit, 2)
str_dup(fruit, 1:3)
str_c("ba", str_dup("na", 0:5))
}
|