Skip to content

Commit

Permalink
Pretties output from get_char_matrix(), adds symbols to labels
Browse files Browse the repository at this point in the history
  • Loading branch information
hlapp committed Nov 7, 2022
1 parent d73f1b3 commit 77af23c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion vignettes/01_rphenoscape.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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
Expand Down

0 comments on commit 77af23c

Please sign in to comment.