The R Project SVN R

Rev

Rev 25278 | Rev 32160 | 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{grid.copy}
1
\name{grid.copy}
2
\alias{grid.copy}
2
\alias{grid.copy}
3
%- Also NEED an `\alias' for EACH other topic documented here.
-
 
4
\title{Make a Copy of a Grid Graphical Object}
3
\title{Make a Copy of a Grid Graphical Object}
5
\description{
4
\description{
6
  Grid graphical objects are references to list structures,
5
  Grid graphical objects are references to list structures, which means
7
  which means that copies of graphical objects ``point'' to the
6
  that copies of graphical objects \dQuote{point} to the same list
8
  same list structure.
7
  structure.
9
 
8
 
10
  This function copies graphical objects by \emph{value}, which means
9
  This function copies graphical objects by \emph{value}, which means
11
  that the copy ``points'' to a separate list structure.
10
  that the copy \dQuote{points} to a separate list structure.
12
}
11
}
13
\usage{
12
\usage{
14
grid.copy(grob)
13
grid.copy(grob)
15
}
14
}
16
%- maybe also `usage' for other objects documented here.
-
 
17
\arguments{
15
\arguments{
18
  \item{grob}{An object of class \code{"grob"}.}
16
  \item{grob}{An object of class \code{"grob"}.}
19
}
17
}
20
\value{
18
\value{
21
  An object of class \code{"grob"}.
19
  An object of class \code{"grob"}.
22
}
20
}
23
\author{Paul Murrell}
21
\author{Paul Murrell}
24
\seealso{
22
\seealso{
25
  \code{\link{grid.grob}}.
23
  \code{\link{grid.grob}}.
26
}
24
}
27
 
-
 
28
\examples{
25
\examples{
29
# Create a graphical object
26
## Create a graphical object
30
l <- grid.lines(draw=FALSE)
27
l <- grid.lines(draw=FALSE)
31
# View the list.struct
28
## View the list.struct
32
grid.get(l)
29
grid.get(l)
33
# Copy by reference
30
## Copy by reference
34
l2 <- l
31
l2 <- l
35
# Edit the common list.struct
32
## Edit the common list.struct
36
grid.edit(l2, gp=gpar(col="green"))
33
grid.edit(l2, gp=gpar(col="green"))
37
# We have modified "l"
34
## We have modified "l"
38
grid.get(l)
35
grid.get(l)
39
# Copy by value
36
## Copy by value
40
l3 <- grid.copy(l)
37
l3 <- grid.copy(l)
41
}
38
}
42
\keyword{ dplot }%-- one or more ...
39
\keyword{dplot}