File: merge.list.Rd

package info (click to toggle)
r-cran-rcurl 1.95-4.8-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,140 kB
  • ctags: 515
  • sloc: ansic: 3,135; xml: 1,734; asm: 993; sh: 12; makefile: 2
file content (47 lines) | stat: -rw-r--r-- 1,318 bytes parent folder | download | duplicates (4)
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
42
43
44
45
46
47
\name{merge.list}
\alias{merge.list}
\title{Method for merging two lists by name}
\description{
  This is a method that merges the contents of one list
  with another by adding the named elements in the second
  that are not in the first.
  In other words, the first list is the target template,
  and the second one adds any extra elements that it has.
}
\usage{
merge.list(x, y, ...)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
  \item{x}{the list to which elements will be added}
  \item{y}{the list which will supply additional elements to \code{x}
    that are not already there by name. }
  \item{\dots}{not used.}
}
\value{
  A named list whose name set is the union of the elements
  in names of x and y and whose values are those taken
  from y and then with those in x, overwriting if necessary.
}
\references{Curl homepage \url{http://curl.haxx.se}}
\author{Duncan Temple Lang <duncan@wald.ucdavis.edu>}

\seealso{
\code{\link[base]{merge}}}
\examples{
\dontrun{
# Not exported.

 merge.list(list(a=1, b = "xyz", c = function(x, y) {x+y}),
             list(a = 2, z = "a string"))

  # No values in y
 merge.list(list(a=1, b = "xyz", c = function(x, y) {x+y}), list())

  # No values in x
 merge.list(list(), list(a=1, b = "xyz", c = function(x, y) {x+y}))
}
}
\keyword{manip}