The R Project SVN R

Rev

Rev 25278 | Rev 38994 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 25278 Rev 25323
Line 1... Line 1...
1
\name{unit.rep}
1
\name{unit.rep}
2
\alias{unit.rep}
2
\alias{unit.rep}
3
%- Also NEED an `\alias' for EACH other topic documented here.
-
 
4
\title{ Replicate Elements of Unit Objects }
3
\title{ Replicate Elements of Unit Objects }
5
\description{
4
\description{
6
  Replicates the units according to the values given
5
  Replicates the units according to the values given in \code{times} and
7
     in `times' and `length.out'.
6
  \code{length.out}.
8
}
7
}
9
\usage{
8
\usage{
10
unit.rep(x, times, length.out)
9
unit.rep(x, times, length.out)
11
}
10
}
12
%- maybe also `usage' for other objects documented here.
-
 
13
\arguments{
11
\arguments{
14
  \item{x}{ An object of class \code{"unit"}. }
12
  \item{x}{ An object of class \code{"unit"}. }
15
  \item{times}{ integer.  A vector giving the number of times to repeat each
13
  \item{times}{integer.  A vector giving the number of times to repeat
16
          element. Either of length 1 or `length(x)'. }
14
    each element.  Either of length 1 or \code{length(x)}. }
17
  \item{length.out}{ integer.  (Optional.)  The desired length of the output
15
  \item{length.out}{integer.  (Optional.)  The desired length of the
18
          vector. }
16
    output vector.}
19
}
17
}
20
\value{
18
\value{
21
  An object of class \code{"unit"}.
19
  An object of class \code{"unit"}.
22
}
20
}
23
\author{ Paul Murrell }
21
\author{ Paul Murrell }
24
 
22
 
25
 \seealso{
23
\seealso{
26
   \code{\link{rep}}
24
  \code{\link{rep}}
27
 }
25
}
28
 
26
 
29
\examples{
27
\examples{
30
unit.rep(unit(1:3, "npc"), 3)
28
unit.rep(unit(1:3, "npc"), 3)
31
unit.rep(unit(1:3, "npc"), 1:3)
29
unit.rep(unit(1:3, "npc"), 1:3)
32
unit.rep(unit(1:3, "npc") + unit(1, "inches"), 3)
30
unit.rep(unit(1:3, "npc") + unit(1, "inches"), 3)
33
unit.rep(max(unit(1:3, "npc") + unit(1, "inches")), 3)
31
unit.rep(max(unit(1:3, "npc") + unit(1, "inches")), 3)
34
unit.rep(max(unit(1:3, "npc") + unit(1, "strwidth", "a"))*4, 3)
32
unit.rep(max(unit(1:3, "npc") + unit(1, "strwidth", "a"))*4, 3)
35
unit.rep(unit(1:3, "npc") + unit(1, "strwidth", "a")*4, 3)
33
unit.rep(unit(1:3, "npc") + unit(1, "strwidth", "a")*4, 3)
36
}
34
}
37
\keyword{ dplot }% at least one, from doc/KEYWORDS
35
\keyword{dplot}