Description Usage Arguments Details Value Examples
View source: R/convert_assoc_tab_to_mat.R
Converts a table of associations to an association matrix with rows as symbionts and columns as host.
1 2 3 | convert_assoc_table_to_matrix(assoc_table)
make_mat(assoc_table)
|
assoc_table |
A dataframe with two columns |
Converts a dataframe with first column listing the host individually and the second column as the symbionts. If hosts have more than one symbiont list these with commas. For example, if the table is a tab-delimited file then a row should read: "Hostus_mostus Symbiont_1, Symbiont_2".
A matrix with rows as symbionts and columns as hosts with 1's representing an association.
1 2 3 4 5 6 7 | file_path <- system.file("extdata",
"gopher_lice_mapping.txt",
package = "treeducken")
gopher_lice_map <- read.table(file_path,
stringsAsFactors = FALSE,
header = TRUE)
gopher_lice_assoc_matrix <- convert_assoc_table_to_matrix(gopher_lice_map)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.