Description Usage Arguments Value Author(s) Examples
This function adds in NAs to fill in missing rows for combining multiple data sources
1 | cbindPad(x, y)
|
|
= vector, matrix |
|
= vector or matrix to join to |
w
unknown, <unknown>@dfo-mpo.gc.ca
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | A = matrix(c(2, 4, 3, 1, 5, 7), nrow=2, ncol=3, byrow = TRUE)
B = matrix(c(1, 5, 7), nrow=3, ncol=1, byrow = TRUE)
cbindPad(A,B)
[,1] [,2] [,3] [,4]
[1,] 2 4 3 1
[2,] 1 5 7 5
[3,] NA NA NA 7
C=c(1,2,3,4,5)
D=c(6,7,8,9,10,11,12,13,14,15)
cbindPad(C,D)
x y
[1,] 1 6
[2,] 2 7
[3,] 3 8
[4,] 4 9
[5,] 5 10
[6,] NA 11
[7,] NA 12
[8,] NA 13
[9,] NA 14
[10,] NA 15
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.