add.col: Add one column from A to B, according to one column of common...

Description Usage Arguments Details Author(s) See Also Examples

Description

This function can be used to add one column from dataframe B to dataframe A, according to the column names speciefied.

Usage

1
add.col(inputA, inputB, add, according)

Arguments

inputA

inputA A dataframe which a column to be added according to one row information. Must contain a column name equals to one column name in dataframe B at the least.

inputB

inputB A dataframe which a column to be abstracted from, must contain a column equals to at least one column name in dataframe A.

add

add the column name in dataframe B to be add to dataframe A. musth be character.

according

according the common column name specified to match the data entries from dataframe A and dataframe B. must be character.

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

1
2
3
4
5
6
7
8
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")

spaa documentation built on May 2, 2019, 9:44 a.m.