matrix2raw | R Documentation |
Converts a numeric matrix M into a dataframe D with three columns (x, factor 1, factor 2) where rows of M are ranks of factor 1 levels and columns of M are ranks of factor 2 levels, missing values are assumed to be 0 or NA. The resulting dataframe D has no missing values.
matrix2raw(M,l1,l2)
M |
Numeric matrix, with missing values assumed to be NA or 0. |
l1 |
Optional numeric vector of level names of column 2 (factor 1)
of returned data frame. If missing it is assigned row numbers of |
l2 |
Optional numeric vector of level names of column 3 (factor 2)
of returned data frame. If missing it is assigned column numbers of |
D |
Data frame with three columns: (y,f1,f1). |
Joerg Schaber
data(DWD) M <- raw2matrix(DWD) # conversion to matrix D1 <- matrix2raw(M) # back conversion, but with different level names D2 <- matrix2raw(M,c(1951:1998),c(1:9)) # with original level names
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.