add.col {spaa} | R Documentation |
Add one column from A to B, according to one column of common name.
Description
This function can be used to add one column from dataframe B to dataframe A, according to the column names speciefied.
Usage
add.col(inputA, inputB, add, according)
Arguments
inputA |
|
inputB |
|
add |
|
according |
|
Details
This function can be used to add one column from dataframe B to dataframe A, according to the column names specified. Users have to make sure the to dataframes at least share the common names specified. This function may be an alternative for merge
Author(s)
Jinlong Zhang
See Also
See Alsomerge
Examples
data(splist)
data(testdata)
## add genera from dataframe B to dataframe A.
add.col(inputA = testdata, inputB = splist, add = "genera",
according = "species")
## add family from dataframe B to dataframe A.
add.col(inputA = testdata, inputB = splist, add = "family",
according = "species")