-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
20 changed files
with
160 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
library(bayesnec) | ||
library(brms) | ||
|
||
test_that("predict is silent", { | ||
expect_silent(predict(nec4param)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
library(bayesnec) | ||
library(dplyr) | ||
|
||
test_that("Check for data when using formula syntax", { | ||
expect_error(bnec(y ~ crf(x, "ecxlin")), "argument \"data\" is missing") | ||
}) | ||
|
||
test_that("Check models inappropriate for negative x are dropped", { | ||
bnec(y ~ crf(log_x, "nechorme4pwr"), data = nec_data) |> | ||
expect_message("Dropping the model\\(s\\) nechorme4pwr as they are not valid for data with negative predictor \\(x\\) values\\.") |> | ||
bnec(y ~ crf(log_x, "nechorme4pwr"), data = nec_data) %>% | ||
expect_message("Dropping the model\\(s\\) nechorme4pwr as they are not valid for data with negative predictor \\(x\\) values\\.") %>% | ||
expect_error("No valid models have been supplied for this data type.") | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,16 @@ | ||
library(bayesnec) | ||
library(dplyr) | ||
|
||
data(manec_example) | ||
|
||
test_that("returns null", { | ||
if (Sys.getenv("NOT_CRAN") == "") { | ||
skip_on_cran() | ||
} | ||
expect_null(check_chains(nec4param)) | ||
}) | ||
|
||
test_that("returns pdf for bayesmanec objects with filename argument", { | ||
if (Sys.getenv("NOT_CRAN") == "") { | ||
skip_on_cran() | ||
} | ||
filename <- random_filename(15) | ||
check_chains(manec_example, filename = filename) |> | ||
expect_invisible() |> | ||
expect_message() | ||
check_chains(manec_example, filename = filename) %>% | ||
expect_invisible %>% | ||
expect_message | ||
on.exit(file.remove(paste(filename, ".pdf", sep = ""))) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.