Skip to content

Commit

Permalink
use httr2 instead of httr
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Oct 4, 2024
1 parent 358d02c commit edb2650
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 34 deletions.
1 change: 0 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ Suggests:
ggdist,
ggplot2,
glmmTMB,
httr,
httr2,
KernSmooth,
knitr,
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-bayesfactor_parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ test_that("bayesfactor_parameters RSTANARM", {
skip_if_offline()
skip_if_not_or_load_if_installed("logspline", "2.1.21")
skip_if_not_or_load_if_installed("rstanarm")
skip_if_not_or_load_if_installed("httr")
skip_if_not_or_load_if_installed("httr2")

fit <- suppressMessages(stan_glm(mpg ~ ., data = mtcars, refresh = 0))

Expand Down Expand Up @@ -93,7 +93,7 @@ test_that("bayesfactor_parameters RSTANARM", {
test_that("bayesfactor_parameters BRMS", {
skip_if_offline()
skip_if_not_or_load_if_installed("logspline", "2.1.21")
skip_if_not_or_load_if_installed("httr")
skip_if_not_or_load_if_installed("httr2")
skip_if_not_or_load_if_installed("brms")
skip_if_not_or_load_if_installed("cmdstanr")
skip_if_not(dir.exists(cmdstanr::cmdstan_default_install_path()))
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-brms.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ test_that("brms", {
skip_on_cran()
skip_if_offline()
skip_if_not_or_load_if_installed("brms")
skip_if_not_or_load_if_installed("httr")
skip_if_not_or_load_if_installed("httr2")

set.seed(333)
model <- insight::download_model("brms_1")
Expand All @@ -57,7 +57,7 @@ test_that("brms", {
skip_on_cran()
skip_if_offline()
skip_if_not_or_load_if_installed("brms")
skip_if_not_or_load_if_installed("httr")
skip_if_not_or_load_if_installed("httr2")

set.seed(333)
model <- insight::download_model("brms_mv_2")
Expand All @@ -81,7 +81,7 @@ test_that("brms", {
skip_on_cran()
skip_if_offline()
skip_if_not_or_load_if_installed("brms")
skip_if_not_or_load_if_installed("httr")
skip_if_not_or_load_if_installed("httr2")

set.seed(333)
model <- insight::download_model("brms_2")
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-ci.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ test_that("ci", {
test_that("ci", {
skip_if_offline()
skip_if_not_or_load_if_installed("rstanarm")
skip_if_not_or_load_if_installed("httr")
skip_if_not_or_load_if_installed("httr2")
skip_if_not_or_load_if_installed("brms")

m <- insight::download_model("stanreg_merMod_5")
Expand All @@ -49,7 +49,7 @@ test_that("ci", {
test_that("rope", {
skip_if_offline()
skip_if_not_or_load_if_installed("rstanarm")
skip_if_not_or_load_if_installed("httr")
skip_if_not_or_load_if_installed("httr2")
skip_if_not_or_load_if_installed("brms")

m <- insight::download_model("brms_zi_3")
Expand Down
12 changes: 6 additions & 6 deletions tests/testthat/test-describe_posterior.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ test_that("describe_posterior", {
skip_if_offline()
skip_if_not_or_load_if_installed("rstanarm")
skip_if_not_or_load_if_installed("brms")
skip_if_not_or_load_if_installed("httr")
skip_if_not_or_load_if_installed("httr2")
skip_if_not_or_load_if_installed("BayesFactor")
skip_on_os("linux")

Expand Down Expand Up @@ -113,7 +113,7 @@ test_that("describe_posterior", {
skip_if_offline()
skip_if_not_or_load_if_installed("rstanarm")
skip_if_not_or_load_if_installed("brms")
skip_if_not_or_load_if_installed("httr")
skip_if_not_or_load_if_installed("httr2")
skip_if_not_or_load_if_installed("BayesFactor")

set.seed(333)
Expand Down Expand Up @@ -250,7 +250,7 @@ test_that("describe_posterior", {
skip_if_offline()
skip_if_not_or_load_if_installed("rstanarm")
skip_if_not_or_load_if_installed("brms")
skip_if_not_or_load_if_installed("httr")
skip_if_not_or_load_if_installed("httr2")
skip_if_not_or_load_if_installed("BayesFactor")

m <- insight::download_model("stanreg_merMod_5")
Expand All @@ -267,7 +267,7 @@ test_that("describe_posterior", {
skip_if_offline()
skip_if_not_or_load_if_installed("rstanarm")
skip_if_not_or_load_if_installed("brms")
skip_if_not_or_load_if_installed("httr")
skip_if_not_or_load_if_installed("httr2")
skip_if_not_or_load_if_installed("BayesFactor")

m <- insight::download_model("brms_zi_3")
Expand All @@ -286,7 +286,7 @@ test_that("describe_posterior w/ BF+SI", {
skip_if_offline()
skip_if_not_or_load_if_installed("rstanarm")
skip_if_not_or_load_if_installed("brms")
skip_if_not_or_load_if_installed("httr")
skip_if_not_or_load_if_installed("httr2")
skip_if_not_or_load_if_installed("BayesFactor")

x <- insight::download_model("stanreg_lm_1")
Expand Down Expand Up @@ -322,7 +322,7 @@ test_that("describe_posterior: BayesFactor", {
skip_if_offline()
skip_if_not_or_load_if_installed("rstanarm")
skip_if_not_or_load_if_installed("brms")
skip_if_not_or_load_if_installed("httr")
skip_if_not_or_load_if_installed("httr2")
skip_if_not_or_load_if_installed("BayesFactor")

set.seed(123)
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-describe_prior.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ test_that("describe_prior", {
skip_if_offline()
skip_if_not_or_load_if_installed("rstanarm")
skip_if_not_or_load_if_installed("brms")
skip_if_not_or_load_if_installed("httr")
skip_if_not_or_load_if_installed("httr2")
skip_if_not_or_load_if_installed("BayesFactor")
skip_on_os("linux")

Expand Down
8 changes: 4 additions & 4 deletions tests/testthat/test-hdi.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ test_that("hdi", {
skip_if_offline()
skip_if_not_or_load_if_installed("rstanarm")
skip_if_not_or_load_if_installed("brms")
skip_if_not_or_load_if_installed("httr")
skip_if_not_or_load_if_installed("httr2")
skip_if_not_or_load_if_installed("BayesFactor")

expect_equal(hdi(distribution_normal(1000), ci = 0.90)$CI_low[1], -1.64, tolerance = 0.02)
Expand All @@ -25,7 +25,7 @@ test_that("ci", {
skip_if_offline()
skip_if_not_or_load_if_installed("rstanarm")
skip_if_not_or_load_if_installed("brms")
skip_if_not_or_load_if_installed("httr")
skip_if_not_or_load_if_installed("httr2")
skip_if_not_or_load_if_installed("BayesFactor")

m <- insight::download_model("stanreg_merMod_5")
Expand All @@ -43,7 +43,7 @@ test_that("rope", {
skip_if_offline()
skip_if_not_or_load_if_installed("rstanarm")
skip_if_not_or_load_if_installed("brms")
skip_if_not_or_load_if_installed("httr")
skip_if_not_or_load_if_installed("httr2")
skip_if_not_or_load_if_installed("BayesFactor")

m <- insight::download_model("brms_zi_3")
Expand All @@ -61,7 +61,7 @@ test_that("ci - BayesFactor", {
skip_if_offline()
skip_if_not_or_load_if_installed("rstanarm")
skip_if_not_or_load_if_installed("brms")
skip_if_not_or_load_if_installed("httr")
skip_if_not_or_load_if_installed("httr2")
skip_if_not_or_load_if_installed("BayesFactor")

mod_bf <- proportionBF(y = 15, N = 25, p = 0.5)
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-point_estimate.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ test_that("point_estimate: stanreg", {
skip_if_offline()
skip_if_not_or_load_if_installed("rstanarm")
skip_if_not_or_load_if_installed("brms")
skip_if_not_or_load_if_installed("httr")
skip_if_not_or_load_if_installed("httr2")

m <- insight::download_model("stanreg_merMod_5")
p <- insight::get_parameters(m, effects = "all")
Expand All @@ -18,7 +18,7 @@ test_that("point_estimate: brms", {
skip_if_offline()
skip_if_not_or_load_if_installed("rstanarm")
skip_if_not_or_load_if_installed("brms")
skip_if_not_or_load_if_installed("httr")
skip_if_not_or_load_if_installed("httr2")

m <- insight::download_model("brms_zi_3")
p <- insight::get_parameters(m, effects = "all", component = "all")
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-print.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ test_that("print.describe_posterior", {
skip_on_cran()
skip_if_offline()
skip_if_not_or_load_if_installed("brms")
skip_if_not_or_load_if_installed("httr")
skip_if_not_or_load_if_installed("httr2")

m <- insight::download_model("brms_zi_3")
expect_snapshot(describe_posterior(m, verbose = FALSE), variant = "windows")
Expand Down
10 changes: 5 additions & 5 deletions tests/testthat/test-rstanarm.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ test_that("rstanarm", {
skip_on_cran()
skip_if_offline()
skip_if_not_or_load_if_installed("rstanarm")
skip_if_not_or_load_if_installed("httr")
skip_if_not_or_load_if_installed("httr2")

set.seed(333)
model <- insight::download_model("stanreg_lm_1")
Expand Down Expand Up @@ -50,7 +50,7 @@ test_that("rstanarm", {
skip_on_cran()
skip_if_offline()
skip_if_not_or_load_if_installed("rstanarm")
skip_if_not_or_load_if_installed("httr")
skip_if_not_or_load_if_installed("httr2")

set.seed(333)
model <- insight::download_model("stanreg_glm_3")
Expand All @@ -69,7 +69,7 @@ test_that("rstanarm", {
skip_on_cran()
skip_if_offline()
skip_if_not_or_load_if_installed("rstanarm")
skip_if_not_or_load_if_installed("httr")
skip_if_not_or_load_if_installed("httr2")

set.seed(333)
model <- insight::download_model("stanreg_merMod_3")
Expand All @@ -89,7 +89,7 @@ test_that("rstanarm", {
skip_on_cran()
skip_if_offline()
skip_if_not_or_load_if_installed("rstanarm")
skip_if_not_or_load_if_installed("httr")
skip_if_not_or_load_if_installed("httr2")

set.seed(333)
model <- insight::download_model("stanmvreg_1")
Expand All @@ -109,7 +109,7 @@ test_that("rstanarm", {
skip_on_cran()
skip_if_offline()
skip_if_not_or_load_if_installed("rstanarm")
skip_if_not_or_load_if_installed("httr")
skip_if_not_or_load_if_installed("httr2")

set.seed(333)
model <- insight::download_model("stanmvreg_1")
Expand Down
8 changes: 4 additions & 4 deletions tests/testthat/test-spi.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ test_that("spi", {
skip_if_offline()
skip_if_not_or_load_if_installed("rstanarm")
skip_if_not_or_load_if_installed("brms")
skip_if_not_or_load_if_installed("httr")
skip_if_not_or_load_if_installed("httr2")
skip_if_not_or_load_if_installed("BayesFactor")

expect_equal(spi(distribution_normal(1000), ci = 0.90)$CI_low[1], -1.65, tolerance = 0.02)
Expand All @@ -25,7 +25,7 @@ test_that("ci", {
skip_if_offline()
skip_if_not_or_load_if_installed("rstanarm")
skip_if_not_or_load_if_installed("brms")
skip_if_not_or_load_if_installed("httr")
skip_if_not_or_load_if_installed("httr2")
skip_if_not_or_load_if_installed("BayesFactor")

m <- insight::download_model("stanreg_merMod_5")
Expand All @@ -42,7 +42,7 @@ test_that("spi brms", {
skip_if_offline()
skip_if_not_or_load_if_installed("rstanarm")
skip_if_not_or_load_if_installed("brms")
skip_if_not_or_load_if_installed("httr")
skip_if_not_or_load_if_installed("httr2")
skip_if_not_or_load_if_installed("BayesFactor")

m <- insight::download_model("brms_zi_3")
Expand All @@ -60,7 +60,7 @@ test_that("ci - BayesFactor", {
skip_if_offline()
skip_if_not_or_load_if_installed("rstanarm")
skip_if_not_or_load_if_installed("brms")
skip_if_not_or_load_if_installed("httr")
skip_if_not_or_load_if_installed("httr2")
skip_if_not_or_load_if_installed("BayesFactor")

mod_bf <- proportionBF(y = 15, N = 25, p = 0.5)
Expand Down
6 changes: 3 additions & 3 deletions vignettes/mediation.Rmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Mediation Analysis using Bayesian Regression Models"
output:
output:
rmarkdown::html_vignette:
toc: true
fig_width: 10.08
Expand All @@ -10,7 +10,7 @@ vignette: >
\usepackage[utf8]{inputenc}
%\VignetteIndexEntry{Mediation Analysis using Bayesian Regression Models}
%\VignetteEngine{knitr::rmarkdown}
editor_options:
editor_options:
chunk_output_type: console
bibliography: bibliography.bib
csl: apa.csl
Expand All @@ -31,7 +31,7 @@ options(width = 80)
if (!requireNamespace("mediation", quietly = TRUE) ||
!requireNamespace("curl", quietly = TRUE) ||
!requireNamespace("httr", quietly = TRUE) ||
!requireNamespace("httr2", quietly = TRUE) ||
!requireNamespace("lavaan", quietly = TRUE) ||
!requireNamespace("brms", quietly = TRUE) ||
!requireNamespace("rstanarm", quietly = TRUE) ||
Expand Down

0 comments on commit edb2650

Please sign in to comment.