From 456ddd1696ec5832e3ef92d86f224e87f8035858 Mon Sep 17 00:00:00 2001 From: George G Vega Yon Date: Mon, 1 Nov 2021 10:53:28 -0700 Subject: [PATCH] ...names() available only since 4.1.0 (issue #20) --- DESCRIPTION | 2 +- R/mcmc.R | 12 ++++++------ R/mcmc_info.R | 7 ++++--- man/MCMC.Rd | 12 ++++++------ vignettes/advanced-features.Rmd | 2 +- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index ff87e4e..dd48cdd 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: fmcmc Title: A friendly MCMC framework Version: 0.5-0 -Date: 2021-07-14 +Date: 2021-09-02 Authors@R: c(person("George", "Vega Yon", email = "g.vegayon@gmail.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-3171-0844")), person("Paul", "Marjoram", email = "pmarjora@usc.edu", role = c("ctb", diff --git a/R/mcmc.R b/R/mcmc.R index adb7972..7af6e0a 100644 --- a/R/mcmc.R +++ b/R/mcmc.R @@ -202,9 +202,9 @@ #' ub = 5, #' scale = 0.01 #' ), -#' nsteps = 1e4, -#' thin = 20, -#' burnin = 5e3 +#' nsteps = 1e3, +#' thin = 10, +#' burnin = 5e2 #' ) #' #' # Checking out the outcomes @@ -237,9 +237,9 @@ #' ub = 5, #' scale = 0.01 #' ), -#' nsteps = 1e4, -#' thin = 20, -#' burnin = 5e3, +#' nsteps = 1e3, +#' thin = 10, +#' burnin = 5e2, #' D = D #' ) #' diff --git a/R/mcmc_info.R b/R/mcmc_info.R index 4491e09..e3204ba 100644 --- a/R/mcmc_info.R +++ b/R/mcmc_info.R @@ -226,9 +226,10 @@ MCMC_init <- function(...) { assign(n, get(n, envir = env), envir = MCMC_OUTPUT$info) # Assigning dots - for (i in seq_len(...length())) { - assign(...names()[i], ...elt(i), envir = MCMC_OUTPUT$info) - } + dotnames <- names(list(...)) + + for (i in seq_len(...length())) + assign(dotnames[i], ...elt(i), envir = MCMC_OUTPUT$info) invisible(NULL) diff --git a/man/MCMC.Rd b/man/MCMC.Rd index ee20739..8b80062 100644 --- a/man/MCMC.Rd +++ b/man/MCMC.Rd @@ -265,9 +265,9 @@ ans <- MCMC( ub = 5, scale = 0.01 ), - nsteps = 1e4, - thin = 20, - burnin = 5e3 + nsteps = 1e3, + thin = 10, + burnin = 5e2 ) # Checking out the outcomes @@ -300,9 +300,9 @@ ans <- MCMC( ub = 5, scale = 0.01 ), - nsteps = 1e4, - thin = 20, - burnin = 5e3, + nsteps = 1e3, + thin = 10, + burnin = 5e2, D = D ) diff --git a/vignettes/advanced-features.Rmd b/vignettes/advanced-features.Rmd index e470f9d..1280313 100644 --- a/vignettes/advanced-features.Rmd +++ b/vignettes/advanced-features.Rmd @@ -184,7 +184,7 @@ Another thing the user may need to do is storing data as the MCMC algorithm runs In such cases, you can use the `set_userdata()` function, which, as the name suggests, will store the required data. -For a simple example, suppose we wanted to store the state, we could do it in the +For a simple example, suppose we wanted to store the proposed state, we could do it in the following way: ```{r lupost4}