Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix warnings in tests #610

Merged
merged 1 commit into from
Jun 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion vignettes/bayes_factors.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"rstanarm", "BayesFactor", "emmeans", "logspline", "lme4", "ggplot2",
"see", "insight", "knitr", "effectsize", "bayestestR"
)
if (!all(sapply(pkgs, require, quietly = TRUE, character.only = TRUE))) {

Check warning on line 44 in vignettes/bayes_factors.Rmd

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=vignettes/bayes_factors.Rmd,line=44,col=10,[undesirable_function_linter] Function "sapply" is undesirable.
knitr::opts_chunk$set(eval = FALSE)
}

Expand Down Expand Up @@ -251,9 +251,9 @@
theme_modern() +
theme(legend.position = c(0.2, 0.8))

My_first_BF <- bayesfactor_parameters(model, null = c(-1, 1), prior = model_prior)

Check warning on line 254 in vignettes/bayes_factors.Rmd

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=vignettes/bayes_factors.Rmd,line=254,col=1,[object_name_linter] Variable and function name style should match snake_case or symbols.

BF <- as.numeric(My_first_BF)[2]

Check warning on line 256 in vignettes/bayes_factors.Rmd

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=vignettes/bayes_factors.Rmd,line=256,col=1,[object_name_linter] Variable and function name style should match snake_case or symbols.
post_odds <- prior_odds * BF

med_post <- point_estimate(posterior)$Median
Expand All @@ -280,7 +280,7 @@
computes a Bayes factor for each of the model's parameters:

```{r, eval=FALSE}
My_first_BF <- bayesfactor_parameters(model, null = c(-1, 1))

Check warning on line 283 in vignettes/bayes_factors.Rmd

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=vignettes/bayes_factors.Rmd,line=283,col=1,[object_name_linter] Variable and function name style should match snake_case or symbols.
My_first_BF
```

Expand Down Expand Up @@ -323,12 +323,12 @@
the point of interest." [@wagenmakers2010bayesian]

```{r, eval=FALSE}
My_second_BF <- bayesfactor_parameters(model, null = 0)

Check warning on line 326 in vignettes/bayes_factors.Rmd

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=vignettes/bayes_factors.Rmd,line=326,col=1,[object_name_linter] Variable and function name style should match snake_case or symbols.
My_second_BF
```

```{r, echo=FALSE}
My_second_BF <- bayesfactor_parameters(

Check warning on line 331 in vignettes/bayes_factors.Rmd

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=vignettes/bayes_factors.Rmd,line=331,col=1,[object_name_linter] Variable and function name style should match snake_case or symbols.
data.frame(group2 = posterior),
data.frame(group2 = prior),
null = 0,
Expand Down Expand Up @@ -360,7 +360,7 @@
verbose = FALSE
)

BF <- as.numeric(test_group2_right)

Check warning on line 363 in vignettes/bayes_factors.Rmd

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=vignettes/bayes_factors.Rmd,line=363,col=1,[object_name_linter] Variable and function name style should match snake_case or symbols.

print(test_group2_right)
```
Expand Down Expand Up @@ -698,7 +698,7 @@
```{r}
model_prior <- unupdate(iris_model)

botanist_BFs <- bayesfactor_restricted(

Check warning on line 701 in vignettes/bayes_factors.Rmd

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=vignettes/bayes_factors.Rmd,line=701,col=1,[object_name_linter] Variable and function name style should match snake_case or symbols.
posterior = iris_model,
prior = model_prior,
hypothesis = botanist_hypotheses
Expand Down Expand Up @@ -799,9 +799,9 @@
```{r JASP_all}
library(BayesFactor)
data(ToothGrowth)
ToothGrowth$dose <- as.factor(ToothGrowth$dose)

Check warning on line 802 in vignettes/bayes_factors.Rmd

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=vignettes/bayes_factors.Rmd,line=802,col=1,[object_name_linter] Variable and function name style should match snake_case or symbols.

BF_ToothGrowth <- anovaBF(len ~ dose * supp, ToothGrowth, progress = FALSE)

Check warning on line 804 in vignettes/bayes_factors.Rmd

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=vignettes/bayes_factors.Rmd,line=804,col=1,[object_name_linter] Variable and function name style should match snake_case or symbols.

bayesfactor_inclusion(BF_ToothGrowth)
```
Expand Down Expand Up @@ -1185,7 +1185,7 @@
chains = 4, iter = 2000, warmup = 1000 # reduce build time
)

em_sum <- emmeans(fit_sum, ~Species) # the posterior marginal means
em_sum <- emmeans(fit_sum, ~Species, data = iris) # the posterior marginal means

bayesfactor_restricted(em_sum, fit_sum, hypothesis = hyp)
```
Expand Down
Loading