Skip to content

Commit

Permalink
Fix try.xts() examples
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaulrich committed Jun 3, 2024
1 parent fb9fd1e commit cc434e2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 6 additions & 4 deletions R/reclass.R
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,17 @@ use.xts <- try.xts
#' @examples
#'
#' a <- 1:10
#' try.xts(a, error = FALSE) # fails silently, still an integer vector
#'
#' # fails silently, the result is still an integer vector
#' try.xts(a, error = FALSE)
#'
#' # control the result with a function
#' try.xts(a, error = function(x, ...) { "I'm afraid I can't do that." })
#'
#' z <- zoo(1:10, timeBasedSeq("2020-01-01/2020-01-10"))
#'
#' str(try.xts(z)) # zoo to xts
#' str(reclass(as.xts(z))) # reclass back to zoo
#' x <- try.xts(z) # zoo to xts
#' str(x)
#' str(reclass(x)) # reclass back to zoo
#'
`reclass` <-
function(x, match.to, error=FALSE, ...) {
Expand Down
10 changes: 6 additions & 4 deletions man/reclass.Rd

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

0 comments on commit cc434e2

Please sign in to comment.