Description Usage Arguments Value Note Examples
View source: R/df_to_comb_matrix.R
Function to convert sepcific columns of a dataframe to a named matrix with value
1 2 3 4 5 6 7 | df_to_comb_matrix(
input.df = data.frame(),
col.margin = 1,
row.margin = 2,
value.margin = 3,
fill = NA
)
|
input.df |
The dataframe contains needed columns |
col.margin |
The index of inputed dataframe's column to be the colname |
row.margin |
The index of inputed dataframe's column to be the rowname |
value.margin |
The index of inputed dataframe's column to be the value |
fill |
The filled in value when no value of a pair is noticed |
A names matrix with values
The value of fill will be filled in if no value of a pair is noticed
1 2 3 4 5 | ## Not run:
A <- data.frame(x = c('a', 'b', 'c'), y = c('A', 'B', 'c'), v = c(3:5))
df_to_comb_matrix(A, col.margin = 2, row.margin = 1, value.margin = 3)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.