Learn R Programming

rtry (version 1.1.0)

rtry_bind_col: Bind data by columns

Description

This function takes a list of data frames or data tables and combines them by columns. The data have to have the same number and sequence of rows.

Usage

rtry_bind_col(..., showOverview = TRUE)

Value

An object of the same type as the first input.

Arguments

...

A list of data frames or data tables to be combined by columns.

showOverview

Default TRUE displays the dimension and column names of the combined data.

References

This function makes use of the bind_cols function within the dplyr package.

See Also

rtry_bind_row, rtry_join_left, rtry_join_outer

Examples

Run this code
# Assuming a user has selected different columns as separated data tables
# and later on would like to combine them as one for further processing.
data1 <- rtry_select_col(data_TRY_15160,
           ObsDataID, ObservationID, AccSpeciesID, AccSpeciesName, ValueKindName,
           TraitID, TraitName, DataID, DataName, OrigObsDataID, ErrorRisk, Comment)

data2 <- rtry_select_col(data_TRY_15160,
           OriglName, OrigValueStr, OrigUnitStr, StdValue, UnitName)

data <- rtry_bind_col(data1, data2)

# Expected messages:
# dim:   1782 12
# col:   ObsDataID ObservationID AccSpeciesID AccSpeciesName ValueKindName TraitID
#        TraitName DataID DataName OrigObsDataID ErrorRisk Comment
#
# dim:   1782 5
# col:   OriglName OrigValueStr OrigUnitStr StdValue UnitName
#
# dim:   1782 17
# col:   ObsDataID ObservationID AccSpeciesID AccSpeciesName ValueKindName TraitID
#        TraitName DataID DataName OrigObsDataID ErrorRisk Comment OriglName
#        OrigValueStr OrigUnitStr StdValue UnitName

Run the code above in your browser using DataLab