File: nstr.Rd

package info (click to toggle)
hmisc 4.2-0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 3,332 kB
  • sloc: asm: 27,116; fortran: 606; ansic: 411; xml: 160; makefile: 2
file content (41 lines) | stat: -rw-r--r-- 1,177 bytes parent folder | download | duplicates (5)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
\name{nstr}
\alias{nstr}

\title{ Creates a string of arbitry length }
\description{
  Creates a vector of strings which consists of the string segment given in
  each element of the \code{string} vector repeated \code{times}.
}
\usage{
nstr(string, times)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
  \item{string}{ character: vector of string segments to be
    repeated.  Will be recycled if argument \code{times} is longer.}
  \item{times}{ integer: vector of number of times to repeat the
    corisponding segment.  Will be recycled if argument \code{string} is
    longer.
  }
}
\value{
  returns a character vector the same length as the longest of the two arguments.
}
\author{ Charles Dupont }
\note{
  Will throw a warning if the length of the longer argment is not a even
  multiple of the shorter argument.
}
\seealso{ \code{\link{paste}}, \code{\link{rep}} }
\examples{
nstr(c("a"), c(0,3,4))

nstr(c("a", "b", "c"), c(1,2,3))

nstr(c("a", "b", "c"), 4)
}
% Add one or more standard keywords, see file 'KEYWORDS' in the
% R documentation directory.
\keyword{manip}
\keyword{character}% __ONLY ONE__ keyword per line
\keyword{utilities}