Merge two mass_dataset objects. More information can be found here https://www.tidymass.org/massdataset/articles/process_info.html
Arguments
- x
(required) A mass_dataset class object.
- y
(required) A mass_dataset class object.
- sample_direction
How to merge samples, should be left, right, inner or full. See ?left_join
- variable_direction
How to merge variables, should be left, right, inner or full.
- sample_by
merge samples by what columns from sample_info.
- variable_by
merge variables by what columns from variable_info
Author
Xiaotao Shen xiaotao.shen@outlook.com
Examples
data("expression_data")
data("sample_info")
data("variable_info")
object <- create_mass_dataset(
expression_data = expression_data,
sample_info = sample_info,
variable_info = variable_info
)
x <- object[1:3, 5:7]
y <- object[2:4, 6:8]
z1 <- merge_mass_dataset(
x = x,
y = y,
sample_direction = "full",
variable_direction = "full"
)
z2 <- merge_mass_dataset(
x = x,
y = y,
sample_direction = "inner",
variable_direction = "full"
)
dim(extract_expression_data(z1))
#> [1] 4 4
dim(extract_expression_data(z2))
#> [1] 4 2
z3 <- merge_mass_dataset(
x = object[1:3, 5:7],
y = object[4:6, 6:8],
sample_direction = "full",
variable_direction = "full"
)
dim(extract_expression_data(z3))
#> [1] 6 4
