diff --git a/NEWS.md b/NEWS.md index cbb2fae..c92de40 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,7 +2,6 @@ * `get_data` method for `dynamitefit` object now correctly uses the previously defined priors instead of the default ones. * Fixed a bug in indexing of random effect terms. - * Limited the number of parallel threads used by the `data.table` package in some examples for CRAN. # dynamite 1.4.4 diff --git a/R/as_draws.R b/R/as_draws.R index b14d66c..72969e2 100644 --- a/R/as_draws.R +++ b/R/as_draws.R @@ -23,10 +23,7 @@ #' @inheritParams as.data.frame.dynamitefit #' @return A `draws_df` object. #' @examples -#' threads <- data.table::getDTthreads() -#' data.table::setDTthreads(threads = 1) # For CRAN #' as_draws(gaussian_example_fit, types = c("sigma", "beta")) -#' data.table::setDTthreads(threads = threads) # Restore #' #' # Compute MCMC diagnostics using the posterior package #' posterior::summarise_draws(as_draws(gaussian_example_fit)) diff --git a/R/dynamite.R b/R/dynamite.R index c19cbbf..51ae9ae 100644 --- a/R/dynamite.R +++ b/R/dynamite.R @@ -135,8 +135,6 @@ #' # Please update your rstan and StanHeaders installation before running #' # on Windows #' if (!identical(.Platform$OS.type, "windows")) { -#' threads <- data.table::getDTthreads() -#' data.table::setDTthreads(threads = 1) # For CRAN #' fit <- dynamite( #' dformula = obs(y ~ -1 + varying(~x), family = "gaussian") + #' lags(type = "varying") + @@ -147,7 +145,6 @@ #' chains = 1, #' refresh = 0 #' ) -#' data.table::setDTthreads(threads = threads) # Restore #' } #' } #' diff --git a/R/mcmc_diagnostics.R b/R/mcmc_diagnostics.R index 0807117..e094de3 100644 --- a/R/mcmc_diagnostics.R +++ b/R/mcmc_diagnostics.R @@ -12,10 +12,7 @@ #' positive (unrestricted) integer. #' @return Returns `x` (invisibly). #' @examples -#' threads <- data.table::getDTthreads() -#' data.table::setDTthreads(threads = 1) # For CRAN #' mcmc_diagnostics(gaussian_example_fit) -#' data.table::setDTthreads(threads = threads) # Restore #' mcmc_diagnostics <- function(x, n) { UseMethod("mcmc_diagnostics", x) diff --git a/R/plot.R b/R/plot.R index 9046fe3..687a585 100644 --- a/R/plot.R +++ b/R/plot.R @@ -97,11 +97,8 @@ plot.dynamitefit <- function(x, parameters = NULL, type = NULL, #' @srrstats {G2.3a} Uses match.arg. #' @srrstats {BS6.1, RE6.0, RE6.1, BS6.3} Implements the `plot` method. #' @examples -#' threads <- data.table::getDTthreads() -#' data.table::setDTthreads(threads = 1) # For CRAN #' plot_deltas(gaussian_example_fit, level = 0.025, scales = "free") + #' ggplot2::theme_minimal() -#' data.table::setDTthreads(threads = threads) # Restore #' plot_deltas <- function(x, parameters = NULL, responses = NULL, level = 0.05, alpha = 0.5, scales = c("fixed", "free"), diff --git a/vignettes/dynamite.Rmd b/vignettes/dynamite.Rmd index 8f90315..dce93a5 100644 --- a/vignettes/dynamite.Rmd +++ b/vignettes/dynamite.Rmd @@ -33,7 +33,6 @@ options(dplyr.summarise.inform = FALSE) options(crayon.enabled = FALSE) options(dplyr.summarise.inform = FALSE) set.seed(0) -data.table::setDTthreads(threads = 1) ``` This vignette is a modification of [@dynamite] which contains more examples and details. diff --git a/vignettes/dynamite_priors.Rmd b/vignettes/dynamite_priors.Rmd index 596c96f..b0630b4 100644 --- a/vignettes/dynamite_priors.Rmd +++ b/vignettes/dynamite_priors.Rmd @@ -33,7 +33,6 @@ options(dplyr.summarise.inform = FALSE) options(crayon.enabled = FALSE) options(dplyr.summarise.inform = FALSE) set.seed(0) -data.table::setDTthreads(threads = 1) ``` # Default prior distributions in dynamite diff --git a/vignettes/dynamite_simulation.Rmd b/vignettes/dynamite_simulation.Rmd index f642902..3e7926a 100644 --- a/vignettes/dynamite_simulation.Rmd +++ b/vignettes/dynamite_simulation.Rmd @@ -20,7 +20,6 @@ knitr::opts_chunk$set( ) library("dynamite") suppressPackageStartupMessages(library("ggplot2")) -data.table::setDTthreads(threads = 1) ``` # Using dynamite to generate panel data