|
20 | 20 | #' @examples
|
21 | 21 | #' ## Write an ape tree to nexml, analgous to write.nexus:
|
22 | 22 | #' library(ape); data(bird.orders)
|
23 |
| -#' write.nexml(bird.orders, file="example.xml") |
| 23 | +#' ex <- tempfile(fileext=".xml") |
| 24 | +#' write.nexml(bird.orders, file=ex) |
24 | 25 | #'
|
25 | 26 | #' \dontrun{ # takes > 5s
|
26 | 27 | #' ## Assemble a nexml section by section and then write to file:
|
|
31 | 32 | #' nexml <- add_basic_meta(title="my title", creator = "Carl Boettiger", nexml = nexml)
|
32 | 33 | #' nexml <- add_meta(meta("prism:modificationDate", format(Sys.Date())), nexml = nexml)
|
33 | 34 | #'
|
34 |
| -#' write.nexml(nexml, file="example.xml") |
| 35 | +#' write.nexml(nexml, file=ex) |
35 | 36 | #'
|
36 | 37 | #' ## As above, but in one call (except for add_meta() call).
|
37 | 38 | #' write.nexml(trees = geospiza$phy,
|
38 | 39 | #' characters = geospiza$dat,
|
39 | 40 | #' title = "My title",
|
40 | 41 | #' creator = "Carl Boettiger",
|
41 |
| -#' file = "example.xml") |
| 42 | +#' file = ex) |
42 | 43 | #'
|
43 | 44 | #' ## Mix and match: identical to the section by section:
|
44 | 45 | #' nexml <- add_meta(meta("prism:modificationDate", format(Sys.Date())))
|
|
47 | 48 | #' characters = geospiza$dat,
|
48 | 49 | #' title = "My title",
|
49 | 50 | #' creator = "Carl Boettiger",
|
50 |
| -#' file = "example.xml") |
| 51 | +#' file = ex) |
51 | 52 | #'
|
52 | 53 | #' }
|
53 | 54 | nexml_write <- function(x = nexml(),
|
|
0 commit comments