vlookup: vlookup function

Description Usage Arguments Examples

View source: R/vlookup.R

Description

To do.

Usage

1
vlookup(x, table, col_return, ..., col_search = 1)

Arguments

x

Search criterion.

table

Array.

col_return

Index.

near_val

Not yet implemented.

sort_order

Not yet implemented.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
shopping <- data.frame(product  = c("Sports Almanac", "Frisbee",
                                    "Water bottles"),
                       quantity = c(1, 3, 6))
seller <- data.frame(product  = c("Frisbee", "Lava lamp", "Sports Almanac",
                                  "Video camera", "Water bottles"),
                     price    = c(7, 20, 35, 75, 3))
shopping$unit_price <- vlookup(shopping$product, seller, "price")
shopping$total_price <- with(shopping, unit_price * quantity)
seller
shopping
sum(shopping$total_price)

chgigot/cgmisc documentation built on May 14, 2019, 8:17 a.m.