Combine exdf objects by columns or rows
cbind.exdf.Rd
Combines one or more exdf
objects by the columns or rows of their
main_data
. For rbind
, errors will occur if column names are not
the same in all of the exdf
objects, and if all units and categories
are not identical.
Examples
# Make some simple exdf objects. 1 and 2 have the same number of rows but
# different columns, while 1 and 3 have the same columns but different rows.
simple_exdf_1 <- exdf(data.frame(A = 1), data.frame(A = 'au'), data.frame(A = 'ac'))
simple_exdf_2 <- exdf(data.frame(B = 2), data.frame(B = 'bu'), data.frame(B = 'bc'))
simple_exdf_3 <- exdf(data.frame(A = 2), data.frame(A = 'au'), data.frame(A = 'ac'))
cbind(simple_exdf_1) # will just return simple_exdf_1
#> A [ac] (au)
#> 1 1
cbind(simple_exdf_1, simple_exdf_2)
#> A [ac] (au) B [bc] (bu)
#> 1 1 2
rbind(simple_exdf_1) # will just return simple_exdf_1
#> A [ac] (au)
#> 1 1
rbind(simple_exdf_1, simple_exdf_3)
#> A [ac] (au)
#> 1 1
#> 2 2