hsMatrixToListForm | R Documentation |
Converts a data frame in "matrix form" to a data frame in "list form"
hsMatrixToListForm(
df,
keyFields,
parFields = setdiff(names(df), keyFields),
colNamePar = "parName",
colNameVal = "parVal",
stringsAsFactors = FALSE
)
df |
data frame |
keyFields |
names of key fields (e.g. date/time) |
parFields |
names of fields representing differen parameters. Default: column names that are not in keyFields |
colNamePar |
name of column in result data frame that will contain the parameter names |
colNameVal |
name of column in result data frame that will contain the parameter values |
stringsAsFactors |
if TRUE, columns of type character in the result data frame are converted to factors. Parameter is passed to cbind, rbind. |
data frame in "list form" (long format)
reshape
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.