Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

cbind_expand

Combine matrices by columns, expanding and aligning rows


Description

This is like base::cbind() but using row names to align the rows and expanding with missing values if there are rows in some matrices but not others.

Usage

cbind_expand(...)

Arguments

...

A set of matrices or data frames

Value

The matrices combined by columns, using row names to align the rows, and expanding with missing values if there are rows in some matrices but not others.

Examples

df1 <- data.frame(x=c(1,2,3,NA,4), y=c(5,8,9,10,11), row.names=c("A", "B", "C", "D", "E"))
df2 <- data.frame(w=c(7,8,0,9,10), z=c(6,NA,NA,9,10), row.names=c("A", "B", "F", "C", "D"))
cbind_expand(df1, df2)

qtl2

Quantitative Trait Locus Mapping in Experimental Crosses

v0.24
GPL-3
Authors
Karl W Broman [aut, cre] (<https://orcid.org/0000-0002-4914-6671>), R Core Team [ctb]
Initial release
2020-12-16

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.