Is there a left join operation that works on DataFrame
class objects and NEVER rearranges the rows? The base merge operation (i.e. S4Vectors::merge
) currently will reorder rows, even when sort = FALSE
.
# This supports S4 columns but will flip rows.
m <- S4Vectors::merge(
x = x, y = y,
by = "gene_id",
all.x = TRUE,
sort = FALSE
)
I'd like to be able to use something like dplyr::left_join()
that supports complex S4 columns (e.g. CompressedCharacterList
), rather than just atomic
and list
columns supported in tibbles.
# This never flips rows, but doesn't support S4.
m <- dplyr::left_join(
x = x, y = y,
by = "gene_id"
)
Thanks Hervé! That's really clever, and exactly what I'm looking for.
Best, Mike