mat2df | R Documentation |
Convert a matrix (or a set of matrices and vectors) with numeric values to a data frame. If only Y is provided, convert the matrix Y to a dataframe of similar dimensions. If additional matrices and/or vectors are provided, the output will be a 'long-reshaped' dataframe.
mat2df(Y, ...)
Y |
A matrix |
... |
An additional set of matrices and vectors. These matrices have to be of similar dimensions than Y. The vectors have to have a similar amount of values than Y or than the number of rows in Y. |
The data frame made of the matrix or the set of inputs. If multiple inputs are provided, the 'long' format data frame will have with two columns + the number of inputs: 'time' and 'id' follow by 'value', 'values.1', 'values.2', etc.
Other convert:
df2mat()
,
fac2num()
,
long()
Y <- df2mat(dfPolicyRate) df = mat2df(Y) head(df) Y <- df2mat(dfPolicyRate) df = mat2df(Y, dim(Y)[2]:1, Y, 1:dim(Y)[2]) tail(df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.