VLOOKUP {ExcelFunctionsR} | R Documentation |
Basic VLOOKUP function from excel
Description
It acts similiarly to Excel's VLOOKUP function with some extra arguments. It takes the value that you want to take from another table and returns the corresponding value from another table. Basically it's an SQL Left Join.
Usage
VLOOKUP(
lookup_from_table,
lookup_column_value = "Name of the column to lookup",
lookup_where_table,
lookup_where_table_column = "Name of the column to compare",
return_which_column = "Name of the column to return"
)
Arguments
lookup_from_table |
The table it should lookup values from |
lookup_column_value |
which column should be looked up |
lookup_where_table |
which table should it look for the values in |
lookup_where_table_column |
Which column should it look for the values in. |
return_which_column |
Which column should it return |
Value
In this case we have built-in database Sales and Street. We try to merge these 2 tables to see on which street are the salesman based on their countries. Function can return numeric,character,logical or any other class, it depends on what is in the table you are looking up the value in.
Examples
VLOOKUP(Sales,"Country",Streets,"Country","Street")
[Package ExcelFunctionsR version 0.1.4 Index]