Description Usage Arguments Examples
Convert a data frame in long format to a numeric matrix
1 | pivot_to_numeric_matrix(data, obs_col, feature_col, value_col)
|
data |
A data frame with numerical values in long format. |
obs_col |
The column listing the observation, or row of the matrix. |
feature_col |
The column listing the feature, or column of the matrix. |
value_col |
The column listing the value, to be placed inside the matrix. The parameters This function requires the packages |
1 2 3 4 5 6 | longdata <- data.frame(
SampleID = paste0("Sample", c(1, 1, 1, 2, 2, 3, 3)),
FeatureID = paste0("Feature", c(1, 2, 3, 1, 2, 2, 3)),
Value = c(132, 41, 7, 56, 11, 929, 83))
longdata
pivot_to_numeric_matrix(longdata, SampleID, FeatureID, Value)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.