/
last_mcmc.R
55 lines (46 loc) · 1.49 KB
/
last_mcmc.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#' Deprecated methods in fmcmc
#'
#' These functions will no longer be included starting version 0.6-0. Instead,
#' use the functions in [mcmc-output].
#'
#' @export
#' @name fmcmc-deprecated
#' @return The function `last_elapsed` returns the elapsed time of the last call
#' to [MCMC]. In particular, the `MCMC` function records the running time of R
#' at the beginning and end of the function using [proc.time()]. So this function
#' returns the difference between the two (`time_end - time_start`).
last_elapsed <- function() {
last_("time_end") - last_("time_start")
}
#' @export
#' @rdname fmcmc-deprecated
LAST_MCMC <- structure(list(), class = "fmcmc_last_mcmc")
#' @export
`[[.fmcmc_last_mcmc` <- function(i, j, ..., exact=TRUE) {
.Deprecated("MCMC_OUTPUT", old = "LAST_MCMC")
MCMC_OUTPUT[[i]]
}
#' @export
`$.fmcmc_last_mcmc` <- function(x, name) {
.Deprecated("MCMC_OUTPUT", old = "LAST_MCMC")
MCMC_OUTPUT[[name]]
}
#' @export
#' @rdname fmcmc-deprecated
last_nsteps <- function() last_("nsteps")
#' @export
#' @rdname fmcmc-deprecated
last_nchains <- function() last_("nchains")
#' @export
#' @rdname fmcmc-deprecated
last_kernel <- function() last_("kernel")
#' @export
#' @rdname fmcmc-deprecated
last_conv_checker <- function() last_("conv_checker")
#' @export
#' @rdname fmcmc-deprecated
#' @param x Name of the object to retrieve.
last_ <- function(x) {
.Deprecated("get_", "The -last_*- methods will be deprecated in the next version of -fmcmc-. Use -get_*- instead.")
get_(x)
}