Skip to content

Commit

Permalink
Add a couple of tips to the tree.
Browse files Browse the repository at this point in the history
  • Loading branch information
sdgamboa committed Jan 3, 2024
1 parent 2932770 commit c558207
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions vignettes/articles/smaller_example.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ In this case, assigng a probability of 1 to A--TRUE and 0 to A--FALSE for
the t1 tip.

```{r}
randomTree <- rtree(5, rooted = TRUE)
set.seed(1234)
randomTree <- rtree(7, rooted = TRUE)
mat <- matrix(
data = rep(0.5, 10), ncol = 2, dimnames = list(
rownames = paste0('t', 1:5), colnames = c('A--TRUE', 'A--FALSE')
data = rep(0.5, Ntip(randomTree) * 2), ncol = 2, dimnames = list(
rownames = paste0('t', 1:Ntip(randomTree)), colnames = c('A--TRUE', 'A--FALSE')
)
)
mat[1,] <- c(1, 0)
annotated_tips <- c('t3', 't2')
for (i in seq_along(annotated_tips)) {
mat[annotated_tips[i], ] <- c(1, 0)
}
mat
```

Expand Down Expand Up @@ -85,13 +89,12 @@ for (i in seq_along(models)) {
fit <- fitMk(tree = randomTree, x = mat, model = models[i], pi = pis[j])
ace <- ancr(fit, tips = TRUE)
plotList[[n]] <- plotT(
randomTree, ace = ace, input_tips = 't1',
randomTree, ace = ace, input_tips = annotated_tips,
model = models[i], pi = pis[j]
)
n <- n + 1
}
}
```

## Print plots
Expand Down

0 comments on commit c558207

Please sign in to comment.