From 77af23c36d1f1556aef8fbb3367b9e2ab4bd2aa0 Mon Sep 17 00:00:00 2001 From: Hilmar Lapp Date: Mon, 7 Nov 2022 16:31:31 -0500 Subject: [PATCH] Pretties output from get_char_matrix(), adds symbols to labels --- vignettes/01_rphenoscape.Rmd | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vignettes/01_rphenoscape.Rmd b/vignettes/01_rphenoscape.Rmd index 7430e6a..2caba12 100644 --- a/vignettes/01_rphenoscape.Rmd +++ b/vignettes/01_rphenoscape.Rmd @@ -97,7 +97,7 @@ Now go to Global Environment pane and click on ‘lundberg_nexml’ to view the To view the full Lundberg (1992) matrix within RStudio, we need to first retrieve the matrix as a data.frame from the NeXML object: ```{r} -lundberg_matrix <- get_char_matrix(lundberg_nexml[[1]]) +lundberg_matrix <- get_char_matrix(lundberg_nexml[[1]], otus_id = FALSE) ``` You can take a look at a small part of the Lundberg (1992) matrix (e.g., the first five taxa and first five characters): @@ -107,6 +107,11 @@ lundberg_matrix[1:5, 1:7] ``` Now navigate to Global Environment and click on ‘lundberg_matrix’ to view the matrix, including the total number of taxa and characters (i.e., the dimensions of the data.frame). To view the entire matrix in this panel, click on the first icon that appears to the right when you hover over the second row. +We can use the information in the NeXML object to convert character state symbols to labels: +```{r} +state_symbols2labels(lundberg_nexml[[1]], charmat = lundberg_matrix)[1:5, 1:7] +``` + Note that all taxa and characters from this study are returned, not just those pertaining to our original search terms. In this example, many anatomical entities other than ‘fin’ and its parts are returned as part of the original study matrix. In a later step, we will learn how to subset a matrix using anatomy or taxonomy terms. ## 5. Get a presence/absence character matrix using OntoTrace in RPhenoscape