mergeList: Merges the information from two lists

Description Usage Arguments See Also Examples

Description

Given lists X and Y, this functions replaces the commonly named objects in X with those of Y and appends the uncommon Y components to X. List X is returned as the merged list.

Usage

1
mergeList(x, y)

Arguments

x

a list of named objects.

y

a list of named objects.

See Also

prettyPrintList.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## develop lists 
dinner <- list(Entree="Spaghetti and Meatballs",
    Starter="Caesar Salad", Dessert="Spumoni",
    Beverage="Wine and Water")

## oops, we are all out of spumoni and we just got 
## some tiramisu in from the local bakery 
change <- list(Dessert="Tiramisu",Note="Please tip your waiter")

## merge the lists and prett-print 
prettyPrintList(mergeList(dinner, change), header="What's for dinner?")

ifultools documentation built on May 2, 2019, 4:48 p.m.