Skip to content

Commit 8a70f2b

Browse files
committed
Fix tests for plot_Scatterplots() ... rebuild
1 parent a284fa6 commit 8a70f2b

File tree

5 files changed

+3
-2
lines changed

5 files changed

+3
-2
lines changed

BayLum.BuildResults/BayLum-Ex.pdf

-879 Bytes
Binary file not shown.

BayLum.BuildResults/BayLum-manual.pdf

0 Bytes
Binary file not shown.
-1 Bytes
Binary file not shown.

R/plot_Scatterplots.R

+2-1
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,15 @@ plot_Scatterplots <- function(
105105

106106
# Verify input --------------------------------------------------------------------------------
107107
if (is.null(attributes(object)$class) || attributes(object)$class != "mcmc.list")
108-
if(attributes(object)$class != "data.frame"){
108+
if(class(object) != "data.frame"){
109109
stop("[plot_Scatterplots()] Wrong input, only objects of type 'mcmc.list' or single 'data.frame' are allowed. Please check the manual!",
110110
call. = FALSE
111111
)
112112

113113

114114
}else{
115115

116+
116117
##check whether the data.frame has two columns
117118
if(ncol(object) < 2)
118119
stop("[plot_Scatterplots()] Your 'data.frame' needs at least two columns!",

tests/testthat/test_plot_Scatterplots.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ test_that("Full function test", {
88

99
##force function stop
1010
expect_error(plot_Scatterplots("test"),
11-
regexp = "Wrong input, only objects of type 'mcmc.list' are allowed. Please check the manual!")
11+
regexp = "Wrong input, only objects of type 'mcmc.list' or single 'data.frame' are allowed. Please check the manual!")
1212
expect_error(plot_Scatterplots(object = AgeS$Sampling, variables = c("A", "B")),
1313
regexp = "You can only select one variable at the time!")
1414
expect_error(plot_Scatterplots(object = AgeS$Sampling, variables = c("B")),

0 commit comments

Comments
 (0)