Description Usage Arguments Details Value Examples
View source: R/expand_columns.R
Row-binds to dataset while insuring column match.
1 | expand_columns(x, y)
|
x, y |
( |
The columns metadata must follow the column, even when transfered
from a dataset to another one. However, while the data.frame
format with
row number equal to data column number, it is not garranty the two data
sets have the same metadata composition. This function, makes sure of the
column match between two datasets before row binding.
A data.frame
with the columns from the two datasets.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | t1 <- data.frame(
row.names = "STUDYID", label = "Study Identifier", names = "name"
)
# | |label |names |
# |:-------|:----------------|:-----|
# |STUDYID |Study Identifier |name |
t2 <- data.frame(
row.names = c("SUBJID", "AGE"),
names = c("Subject Identifier", "Age")
)
# | |names |
# |:------|:------------------|
# |SUBJID |Subject Identifier |
# |AGE |Age |
expand_columns(t1, t2)
# | |label |names |
# |:-------|:----------------|:------------------|
# |STUDYID |Study Identifier |name |
# |SUBJID |NA |Subject Identifier |
# |AGE |NA |Age |
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.