Skip to content

Commit a1107e8

Browse files
committed
Working on documentation
1 parent 18db035 commit a1107e8

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

R/aphylo_mcmc.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#' @details `APHYLO_DEFAULT_MCMC_CONTROL` lists the default values for the MCMC
44
#' estimation:
55
#' - `nsteps`: \Sexpr{aphylo::APHYLO_DEFAULT_MCMC_CONTROL$nsteps}
6-
#' - `nsteps`: \Sexpr{aphylo::APHYLO_DEFAULT_MCMC_CONTROL$burnin}
6+
#' - `burnin`: \Sexpr{aphylo::APHYLO_DEFAULT_MCMC_CONTROL$burnin}
77
#' - `thin` : \Sexpr{aphylo::APHYLO_DEFAULT_MCMC_CONTROL$thin}
88
#' - `nchains` : \Sexpr{aphylo::APHYLO_DEFAULT_MCMC_CONTROL$nchains}
99
#' - `multicore` : \Sexpr{aphylo::APHYLO_DEFAULT_MCMC_CONTROL$multicore}

R/simulation.R

+11-1
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ sim_fun_on_tree <- function(
255255
#' @templateVar .Pi 1
256256
#' @templateVar .types 1
257257
#' @param informative,maxtries Passed to [sim_fun_on_tree].
258+
#' @param edge.length Passed to [sim_tree].
258259
#' @return An object of class [aphylo]
259260
#' @family Simulation Functions
260261
#' @export
@@ -267,6 +268,7 @@ sim_fun_on_tree <- function(
267268
raphylo <- function(
268269
n = NULL,
269270
tree = NULL,
271+
edge.length = NULL,
270272
tip.type = NULL,
271273
node.type = function(n) sample.int(2, size = n, replace = TRUE, prob = c(.2, .8)) - 1,
272274
P = 1L,
@@ -286,7 +288,15 @@ raphylo <- function(
286288
# Checking if there's n
287289
if (!length(n))
288290
stop("When -tree- is not specified, -n- must be specified.")
289-
tree <- sim_tree(n)
291+
tree <- do.call(
292+
sim_tree, c(
293+
list(n = n),
294+
if (is.null(edge.length))
295+
list(edge.length = edge.length)
296+
else
297+
NULL
298+
)
299+
)
290300

291301
} else if (is.aphylo(tree)) {
292302

man/aphylo_mcmc.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/raphylo.Rd

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vignettes/example.Rmd

+1-4
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,10 @@ If needed, we can export the data as follows:
4646

4747
```{r eval=FALSE}
4848
# Edgelist describing parent->offspring relations
49-
edges <- x$tree$edge
50-
colnames(edges) <- c("parent", "offspring")
51-
write.csv(edges, file = "edgelist.csv", row.names = FALSE)
49+
write.csv(x$tree, file = "tree.tree", row.names = FALSE)
5250
5351
# Tip annotations
5452
ann <- with(x, rbind(tip.annotation, node.annotation))
55-
rownames(ann) <- 1L:nrow(ann)
5653
write.csv(ann, file = "annotations.csv", row.names = FALSE)
5754
5855
# Event types

0 commit comments

Comments
 (0)