Skip to content

Commit

Permalink
avoid examples writing to non-tempfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
cboettig committed Nov 8, 2019
1 parent 320024f commit 4e3eae9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
9 changes: 5 additions & 4 deletions R/nexml_write.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
#' @examples
#' ## Write an ape tree to nexml, analgous to write.nexus:
#' library(ape); data(bird.orders)
#' write.nexml(bird.orders, file="example.xml")
#' ex <- tempfile(fileext=".xml")
#' write.nexml(bird.orders, file=ex)
#'
#' \dontrun{ # takes > 5s
#' ## Assemble a nexml section by section and then write to file:
Expand All @@ -31,14 +32,14 @@
#' nexml <- add_basic_meta(title="my title", creator = "Carl Boettiger", nexml = nexml)
#' nexml <- add_meta(meta("prism:modificationDate", format(Sys.Date())), nexml = nexml)
#'
#' write.nexml(nexml, file="example.xml")
#' write.nexml(nexml, file=ex)
#'
#' ## As above, but in one call (except for add_meta() call).
#' write.nexml(trees = geospiza$phy,
#' characters = geospiza$dat,
#' title = "My title",
#' creator = "Carl Boettiger",
#' file = "example.xml")
#' file = ex)
#'
#' ## Mix and match: identical to the section by section:
#' nexml <- add_meta(meta("prism:modificationDate", format(Sys.Date())))
Expand All @@ -47,7 +48,7 @@
#' characters = geospiza$dat,
#' title = "My title",
#' creator = "Carl Boettiger",
#' file = "example.xml")
#' file = ex)
#'
#' }
nexml_write <- function(x = nexml(),
Expand Down
2 changes: 1 addition & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Dear CRAN maintainers,
This update addresses several minor issues and feature requests, as detailed in NEWS.md.
This package shows two notes, one indicating that I am the maintainer, the other noting that this package
has one suggested dependency on a non-mainstream repository, which is used
to illustrate an additional feature in one of vignettes, when available.
to illustrate an additional feature in one of vignettes, when available. (This is not a new suggested dependency, it is already listed in the current CRAN version as well.)

Cheers,

Expand Down
9 changes: 5 additions & 4 deletions man/nexml_write.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4e3eae9

Please sign in to comment.