Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
stressaddition
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
oekotox
stressaddition
Commits
8a0ac30c
Commit
8a0ac30c
authored
4 years ago
by
Sebastian Henz
Browse files
Options
Downloads
Patches
Plain Diff
Make regression tests more robust
parent
d7c88029
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#7517
passed with stage
in 11 minutes and 16 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
DESCRIPTION
+1
-1
1 addition, 1 deletion
DESCRIPTION
tests/testthat/test-ecxsys.R
+58
-67
58 additions, 67 deletions
tests/testthat/test-ecxsys.R
tests/testthat/test-lc.R
+5
-5
5 additions, 5 deletions
tests/testthat/test-lc.R
tests/testthat/test-multi_tox.R
+24
-21
24 additions, 21 deletions
tests/testthat/test-multi_tox.R
with
88 additions
and
94 deletions
DESCRIPTION
+
1
−
1
View file @
8a0ac30c
...
@@ -2,7 +2,7 @@ Package: stressaddition
...
@@ -2,7 +2,7 @@ Package: stressaddition
Type: Package
Type: Package
Title: Modelling Tri-Phasic Concentration-Response Relationships
Title: Modelling Tri-Phasic Concentration-Response Relationships
Version: 3.0.2
Version: 3.0.2
Date: 2020-09-0
4
Date: 2020-09-0
9
Authors@R: c(person("Sebastian",
Authors@R: c(person("Sebastian",
"Henz",
"Henz",
role = c("aut", "cre"),
role = c("aut", "cre"),
...
...
This diff is collapsed.
Click to expand it.
tests/testthat/test-ecxsys.R
+
58
−
67
View file @
8a0ac30c
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
mod
<-
ecxsys
(
mod
el
<-
ecxsys
(
concentration
=
c
(
0
,
0.05
,
0.5
,
5
,
30
),
concentration
=
c
(
0
,
0.05
,
0.5
,
5
,
30
),
hormesis_concentration
=
0.5
,
hormesis_concentration
=
0.5
,
survival_tox_observed
=
c
(
90
,
81
,
92
,
28
,
0
),
survival_tox_observed
=
c
(
90
,
81
,
92
,
28
,
0
),
...
@@ -84,95 +84,86 @@ test_that("error when hormesis_index <= 2 or >= (length(concentration))", {
...
@@ -84,95 +84,86 @@ test_that("error when hormesis_index <= 2 or >= (length(concentration))", {
test_that
(
"min(concentration) == 0 is shifted the correct amount"
,
{
test_that
(
"min(concentration) == 0 is shifted the correct amount"
,
{
expect_equal
(
mod
$
curves
$
concentration
[
1
]
*
10
^
5
,
0.0001
)
expect_equal
(
mod
el
$
curves
$
concentration
[
1
]
*
10
^
5
,
0.0001
)
})
})
test_that
(
"the discrete results have not changed"
,
{
test_that
(
"the discrete results have not changed"
,
{
expect_equal
(
expect_equal
(
mod
$
survival_tox_LL5
,
round
(
model
$
survival_tox_LL5
,
3
),
c
(
90
,
89.745092
,
82.340325
,
26.787104
,
4.306868
),
c
(
90
,
89.745
,
82.340
,
26.787
,
4.307
)
tolerance
=
1e-4
)
)
expect_equal
(
expect_equal
(
mod
$
survival_tox
,
round
(
model
$
survival_tox
,
3
),
c
(
100
,
99.455327884
,
92.000028403
,
27.999995346
,
0.002452598
),
c
(
100
,
99.455
,
92
,
28
,
0.002
)
tolerance
=
1e-4
)
)
expect_equal
(
expect_equal
(
mod
$
stress_tox
,
round
(
model
$
stress_tox
,
3
),
c
(
0
,
0.09296422
,
0.23401450
,
0.61804415
,
0.98352101
),
c
(
0
,
0.093
,
0.234
,
0.618
,
0.984
)
tolerance
=
1e-4
)
)
expect_equal
(
expect_equal
(
mod
$
sys_tox_observed
,
round
(
model
$
sys_tox_observed
,
3
),
c
(
0.2541156
,
0.2324304
,
0
,
0
,
0
),
c
(
0.254
,
0.232
,
0
,
0
,
0
)
tolerance
=
1e-4
)
)
expect_equal
(
expect_equal
(
mod
$
survival_tox_sys
,
round
(
model
$
survival_tox_sys
,
3
),
c
(
89.920669034
,
81.890300846
,
90.863799559
,
27.999995346
,
0.002452598
),
c
(
89.921
,
81.890
,
90.864
,
28
,
0.002
)
tolerance
=
1e-4
)
)
expect_equal
(
mod
$
stress_env
,
0.35
5
6
369
,
tolerance
=
1e-4
)
expect_equal
(
round
(
mod
el
$
stress_env
,
3
),
0.356
)
expect_equal
(
expect_equal
(
mod
$
survival_tox_env_LL5
,
round
(
model
$
survival_tox_env_LL5
,
3
),
c
(
29.6666667
,
29.6666657
,
29.5214959
,
5.4076411
,
0.7871201
),
c
(
29.667
,
29.667
,
29.521
,
5.408
,
0.787
)
tolerance
=
1e-4
)
)
expect_equal
(
expect_equal
(
mod
$
stress_tox_env
,
round
(
model
$
stress_tox_env
,
3
),
c
(
0.3556369
,
0.4486011
,
0.5896514
,
0.9736810
,
1.3391579
),
c
(
0.356
,
0.449
,
0.59
,
0.974
,
1.339
)
tolerance
=
1e-4
)
)
expect_equal
(
expect_equal
(
mod
$
survival_tox_env
,
round
(
model
$
survival_tox_env
,
3
),
c
(
76.36558967
,
59.90195211
,
33
,
0.01079038
,
0
),
c
(
76.366
,
59.902
,
33
,
0.011
,
0
)
tolerance
=
1e-4
)
)
expect_equal
(
expect_equal
(
mod
$
sys_tox_env_observed
,
round
(
model
$
sys_tox_env_observed
,
3
),
c
(
0.2566005
,
0.1753250
,
0
,
0
,
0
),
c
(
0.257
,
0.175
,
0
,
0
,
0
)
tolerance
=
1e-4
)
)
expect_equal
(
expect_equal
(
mod
$
survival_tox_env_sys
,
round
(
model
$
survival_tox_env_sys
,
3
),
c
(
29.37633973
,
25.99861674
,
30.16676004
,
0.01079038
,
0
),
c
(
29.376
,
25.999
,
30.167
,
0.011
,
0
)
tolerance
=
1e-4
)
)
})
})
test_that
(
"the curves have not changed"
,
{
test_that
(
"the curves have not changed"
,
{
new_curves
<-
mod
$
curves
[
c
(
1
,
714
,
810
,
905
,
1000
),
]
# random indices
new_curves
<-
model
$
curves
[
c
(
1
,
714
,
810
,
905
,
1000
),
]
# random indices
new_curves
<-
round
(
new_curves
,
3
)
rownames
(
new_curves
)
<-
NULL
rownames
(
new_curves
)
<-
NULL
reference_curves
<-
data.frame
(
reference_curves
<-
data.frame
(
concentration
=
c
(
0
.00000
,
0.03
004
,
0.305
12
,
3.02
551
,
30.0000
0
),
concentration
=
c
(
0
,
0.03
,
0.305
,
3.02
6
,
3
0
),
survival_tox_LL5
=
c
(
90
.00000
,
89.882
45
,
86.18
591
,
40.42
560
,
4.30
68
7
),
survival_tox_LL5
=
c
(
90
,
89.882
,
86.18
6
,
40.42
6
,
4.307
),
survival_tox_env_LL5
=
c
(
29.
66
667
,
29.
66
667
,
29.655
30
,
9.276
16
,
0.787
12
),
survival_tox_env_LL5
=
c
(
29.667
,
29.667
,
29.655
,
9.276
,
0.787
),
survival_tox
=
c
(
100
.00000
,
99.70
167
,
95.459
44
,
49.54
173
,
0.002
45
),
survival_tox
=
c
(
100
,
99.70
2
,
95.459
,
49.54
2
,
0.002
),
stress_tox
=
c
(
0
.00013
,
0.076
31
,
0.19
093
,
0.502
36
,
0.98
352
),
stress_tox
=
c
(
0
,
0.076
,
0.19
1
,
0.502
,
0.98
4
),
sys_tox
=
c
(
0.25
487
,
0.24
017
,
0.05
66
7
,
0
.00000
,
0.0000
0
),
sys_tox
=
c
(
0.25
5
,
0.24
,
0.057
,
0
,
0
),
stress_tox_sys
=
c
(
0.25
499
,
0.316
48
,
0.24
760
,
0.502
36
,
0.98
352
),
stress_tox_sys
=
c
(
0.25
5
,
0.316
,
0.24
8
,
0.502
,
0.98
4
),
survival_tox_sys
=
c
(
89.907
35
,
82.279
32
,
90.675
15
,
49.54
173
,
0.002
45
),
survival_tox_sys
=
c
(
89.907
,
82.279
,
90.675
,
49.54
2
,
0.002
),
stress_env
=
c
(
0.35
564
,
0.35
5
6
4
,
0.35
5
6
4
,
0.35
564
,
0.35
564
),
stress_env
=
c
(
0.35
6
,
0.356
,
0.356
,
0.35
6
,
0.35
6
),
stress_tox_env
=
c
(
0.35
57
6
,
0.43
195
,
0.54
65
7
,
0.858
00
,
1.339
16
),
stress_tox_env
=
c
(
0.356
,
0.43
2
,
0.547
,
0.858
,
1.339
),
survival_tox_env
=
c
(
76.345
46
,
63.03
379
,
41.01
651
,
1.93
183
,
0.0000
0
),
survival_tox_env
=
c
(
76.345
,
63.03
4
,
41.01
7
,
1.93
2
,
0
),
sys_tox_env
=
c
(
0.254
43
,
0.20
496
,
0.044
45
,
0
.00000
,
0.0000
0
),
sys_tox_env
=
c
(
0.254
,
0.20
5
,
0.044
,
0
,
0
),
stress_tox_env_sys
=
c
(
0.61
020
,
0.63
691
,
0.591
02
,
0.858
00
,
1.339
16
),
stress_tox_env_sys
=
c
(
0.61
,
0.63
7
,
0.591
,
0.858
,
1.339
),
survival_tox_env_sys
=
c
(
29.354
49
,
24.841
47
,
32.75
385
,
1.93
18
2
,
0
),
survival_tox_env_sys
=
c
(
29.354
,
24.841
,
32.75
4
,
1.932
,
0
),
concentration_for_plots
=
c
(
0.000
1
,
0.03
004
,
0.305
12
,
3.02
551
,
30
)
concentration_for_plots
=
c
(
0.000
,
0.03
,
0.305
,
3.02
6
,
30
)
)
)
class
(
new_curves
)
<-
class
(
reference_curves
)
class
(
new_curves
)
<-
class
(
reference_curves
)
expect_equal
(
new_curves
,
reference_curves
,
tolerance
=
1e-3
)
expect_equal
(
new_curves
,
reference_curves
)
})
})
test_that
(
"the returned fn works the same way as internally"
,
{
test_that
(
"the returned fn works the same way as internally"
,
{
# I don't know why it would fail but it doesn't hurt to test it.
# I don't know why it would fail but it doesn't hurt to test it.
curves
<-
mod
$
curves
curves
<-
mod
el
$
curves
curves
$
concentration_for_plots
<-
NULL
curves
$
concentration_for_plots
<-
NULL
expect_identical
(
curves
,
predict_ecxsys
(
mod
,
curves
$
concentration
))
expect_identical
(
curves
,
predict_ecxsys
(
mod
el
,
curves
$
concentration
))
})
})
...
@@ -187,7 +178,7 @@ test_that("function arguments are returned unchanged", {
...
@@ -187,7 +178,7 @@ test_that("function arguments are returned unchanged", {
p
=
3.2
,
p
=
3.2
,
q
=
3.2
q
=
3.2
)
)
expect_identical
(
args_reference
,
mod
$
args
)
expect_identical
(
args_reference
,
mod
el
$
args
)
})
})
...
@@ -199,15 +190,15 @@ ecxsys(
...
@@ -199,15 +190,15 @@ ecxsys(
)
)
test_that
(
"results are independent of concentration shift"
,
{
test_that
(
"results are independent of concentration shift"
,
{
mod_2
<-
ecxsys
(
mod
el
_2
<-
ecxsys
(
concentration
=
c
(
0
,
0.05
,
0.5
,
5
,
30
)
*
2
,
concentration
=
c
(
0
,
0.05
,
0.5
,
5
,
30
)
*
2
,
hormesis_concentration
=
0.5
*
2
,
hormesis_concentration
=
0.5
*
2
,
survival_tox_observed
=
c
(
90
,
81
,
92
,
28
,
0
),
survival_tox_observed
=
c
(
90
,
81
,
92
,
28
,
0
),
survival_tox_env_observed
=
c
(
29
,
27
,
33
,
5
,
0
)
survival_tox_env_observed
=
c
(
29
,
27
,
33
,
5
,
0
)
)
)
expect_equal
(
mod
$
survival_tox_sys
,
mod_2
$
survival_tox_sys
)
expect_equal
(
mod
el
$
survival_tox_sys
,
mod
el
_2
$
survival_tox_sys
)
expect_equal
(
mod
$
survival_tox_env_sys
,
mod_2
$
survival_tox_env_sys
)
expect_equal
(
mod
el
$
survival_tox_env_sys
,
mod
el
_2
$
survival_tox_env_sys
)
mod_10
<-
ecxsys
(
mod
el
_10
<-
ecxsys
(
concentration
=
c
(
0
,
0.05
,
0.5
,
5
,
30
)
*
10
,
concentration
=
c
(
0
,
0.05
,
0.5
,
5
,
30
)
*
10
,
hormesis_concentration
=
0.5
*
10
,
hormesis_concentration
=
0.5
*
10
,
survival_tox_observed
=
c
(
90
,
81
,
92
,
28
,
0
),
survival_tox_observed
=
c
(
90
,
81
,
92
,
28
,
0
),
...
@@ -215,24 +206,24 @@ test_that("results are independent of concentration shift", {
...
@@ -215,24 +206,24 @@ test_that("results are independent of concentration shift", {
)
)
# Concentration shifts by factors other than powers of 10 may affect
# Concentration shifts by factors other than powers of 10 may affect
# the result because of the way the zero concentration is "corrected".
# the result because of the way the zero concentration is "corrected".
expect_equal
(
mod
$
curves
$
survival_tox
,
expect_equal
(
mod
el
$
curves
$
survival_tox
,
mod_10
$
curves
$
survival_tox
)
mod
el
_10
$
curves
$
survival_tox
)
expect_equal
(
mod
$
curves
$
survival_tox_sys
,
expect_equal
(
mod
el
$
curves
$
survival_tox_sys
,
mod_10
$
curves
$
survival_tox_sys
)
mod
el
_10
$
curves
$
survival_tox_sys
)
expect_equal
(
mod
$
curves
$
survival_tox_env_sys
,
expect_equal
(
mod
el
$
curves
$
survival_tox_env_sys
,
mod_10
$
curves
$
survival_tox_env_sys
)
mod
el
_10
$
curves
$
survival_tox_env_sys
)
})
})
test_that
(
"survival_tox_env_observed can be left out"
,
{
test_that
(
"survival_tox_env_observed can be left out"
,
{
mod_without_env
<-
ecxsys
(
mod
el
_without_env
<-
ecxsys
(
concentration
=
c
(
0
,
0.05
,
0.5
,
5
,
30
),
concentration
=
c
(
0
,
0.05
,
0.5
,
5
,
30
),
hormesis_concentration
=
0.5
,
hormesis_concentration
=
0.5
,
survival_tox_observed
=
c
(
90
,
81
,
92
,
28
,
0
)
survival_tox_observed
=
c
(
90
,
81
,
92
,
28
,
0
)
)
)
expect_equal
(
mod
$
survival_tox_sys
,
mod_without_env
$
survival_tox_sys
)
expect_equal
(
mod
el
$
survival_tox_sys
,
mod
el
_without_env
$
survival_tox_sys
)
expect_equal
(
mod
$
curves
$
survival_tox_sys
,
expect_equal
(
mod
el
$
curves
$
survival_tox_sys
,
mod_without_env
$
curves
$
survival_tox_sys
)
mod
el
_without_env
$
curves
$
survival_tox_sys
)
})
})
...
...
This diff is collapsed.
Click to expand it.
tests/testthat/test-lc.R
+
5
−
5
View file @
8a0ac30c
...
@@ -43,9 +43,9 @@ test_that("all input formats produce identical models", {
...
@@ -43,9 +43,9 @@ test_that("all input formats produce identical models", {
)
)
ec10_d
<-
lc
(
df_custom
,
"foo"
,
10
)
ec10_d
<-
lc
(
df_custom
,
"foo"
,
10
)
expect_equal
(
ec10_a
,
ec10_b
,
tolerance
=
1e-
5
)
expect_equal
(
ec10_a
,
ec10_b
,
tolerance
=
1e-
3
)
expect_equal
(
ec10_b
,
ec10_c
,
tolerance
=
1e-
5
)
expect_equal
(
ec10_b
,
ec10_c
,
tolerance
=
1e-
3
)
expect_equal
(
ec10_c
,
ec10_d
,
tolerance
=
1e-
5
)
expect_equal
(
ec10_c
,
ec10_d
,
tolerance
=
1e-
3
)
})
})
...
@@ -107,11 +107,11 @@ test_that("reference argument works", {
...
@@ -107,11 +107,11 @@ test_that("reference argument works", {
expect_equal
(
expect_equal
(
lc
(
model
,
"survival_tox_LL5"
,
50
,
reference
=
100
),
lc
(
model
,
"survival_tox_LL5"
,
50
,
reference
=
100
),
list
(
response
=
50
,
concentration
=
2.208119
),
list
(
response
=
50
,
concentration
=
2.208119
),
tolerance
=
1e-
4
tolerance
=
1e-
3
)
)
expect_equal
(
expect_equal
(
lc
(
model
,
"survival_tox_LL5"
,
50
,
reference
=
75
),
lc
(
model
,
"survival_tox_LL5"
,
50
,
reference
=
75
),
list
(
response
=
37.5
,
concentration
=
3.342715
),
list
(
response
=
37.5
,
concentration
=
3.342715
),
tolerance
=
1e-
4
tolerance
=
1e-
3
)
)
})
})
This diff is collapsed.
Click to expand it.
tests/testthat/test-multi_tox.R
+
24
−
21
View file @
8a0ac30c
...
@@ -41,17 +41,18 @@ test_that("results have not changed", {
...
@@ -41,17 +41,18 @@ test_that("results have not changed", {
5
,
5
,
0.7
0.7
)
)
new
<-
round
(
new
,
3
)
reference
<-
data.frame
(
reference
<-
data.frame
(
concentration_a
=
c
(
0
,
0.01
,
0.1
,
1
,
7
,
15
),
concentration_a
=
c
(
0
,
0.01
,
0.1
,
1
,
7
,
15
),
concentration_b
=
5
,
concentration_b
=
5
,
survival
=
c
(
88.57
4578
,
84.361
552
,
80.63
376
2
,
56.73
0550
,
2.88
2718
,
0
),
survival
=
c
(
88.57
5
,
84.361
,
80.632
,
56.73
1
,
2.88
3
,
0
),
stress_tox_sa
=
c
(
0.18
86787
,
0.24
36883
,
0.31
85115
,
0.511
1081
,
0.89
04295
,
1.07
00716
),
stress_tox_sa
=
c
(
0.18
9
,
0.24
4
,
0.31
9
,
0.511
,
0.89
,
1.07
),
stress_tox_ca
=
c
(
0.18
867873
,
0.19199327
,
0.21634282
,
3.579444e-01
,
7.126441e-01
,
8.856914e-01
),
stress_tox_ca
=
c
(
0.18
9
,
0.192
,
0.216
,
0.358
,
0.713
,
0.886
),
stress_tox
=
c
(
0.18
867873
,
0.228
17978
,
0.28
786093
,
4.651590e-01
,
8.370939e-01
,
1.01
4758
),
stress_tox
=
c
(
0.18
9
,
0.228
,
0.28
8
,
0.465
,
0.837
,
1.01
5
),
sys
=
c
(
0.078
45536
,
0.073
12129
,
0.04
004696
,
4.663355e-05
,
0
,
0
),
sys
=
c
(
0.078
,
0.073
,
0.04
,
0
,
0
,
0
),
stress_total
=
c
(
0.267
13409
,
0.301
30107
,
0.32
790789
,
4.652056e-01
,
8.370939e-01
,
1.01
4758
)
stress_total
=
c
(
0.267
,
0.301
,
0.32
8
,
0.465
,
0.837
,
1.01
5
)
)
)
expect_equal
(
new
,
reference
,
tolerance
=
1e-5
)
expect_equal
(
new
,
reference
)
# diverse concentration_b
# diverse concentration_b
new
<-
multi_tox
(
new
<-
multi_tox
(
...
@@ -61,17 +62,18 @@ test_that("results have not changed", {
...
@@ -61,17 +62,18 @@ test_that("results have not changed", {
c
(
0
,
0.02
,
0.2
,
2
,
14
,
30
),
c
(
0
,
0.02
,
0.2
,
2
,
14
,
30
),
0.7
0.7
)
)
new
<-
round
(
new
,
3
)
reference
<-
data.frame
(
reference
<-
data.frame
(
concentration_a
=
c
(
0
,
0.01
,
0.1
,
1
,
7
,
15
),
concentration_a
=
c
(
0
,
0.01
,
0.1
,
1
,
7
,
15
),
concentration_b
=
c
(
0
,
0.02
,
0.2
,
2
,
14
,
30
),
concentration_b
=
c
(
0
,
0.02
,
0.2
,
2
,
14
,
30
),
survival
=
c
(
88.2
698383
,
79.96
171270
,
78.157
4808
,
6.579998e+01
,
3.861678e-01
,
0
),
survival
=
c
(
88.2
70
,
79.96
2
,
78.157
,
65.8
,
0.386
,
0
),
stress_tox_sa
=
c
(
0
,
0.07
567745
,
0.1807501
,
4.510696e-01
,
9.961584e-01
,
1.294
227
),
stress_tox_sa
=
c
(
0
,
0.07
6
,
0.181
,
0.451
,
0.996
,
1.294
),
stress_tox_ca
=
c
(
0
,
0.05
654834
,
0.134
3429
,
3
.3
67461e-01
,
7.321990e-01
,
9.063311e-01
),
stress_tox_ca
=
c
(
0
,
0.05
7
,
0.134
,
0
.3
37
,
0.732
,
0.906
),
stress_tox
=
c
(
0
,
0.0
6993872
,
0.1668279
,
4.167725e-01
,
9.169706e-01
,
1.17
785
8
),
stress_tox
=
c
(
0
,
0.0
7
,
0.167
,
0.417
,
0.917
,
1.178
),
sys
=
c
(
0.2
698033
,
0.262
48944
,
0.177
4490
,
1.829786e-04
,
0
,
0
),
sys
=
c
(
0.2
7
,
0.262
,
0.177
,
0
,
0
,
0
),
stress_total
=
c
(
0.2
698033
,
0.332
42815
,
0.344
2769
,
4.169555e-01
,
9.169706e-01
,
1.17
785
8
)
stress_total
=
c
(
0.2
7
,
0.332
,
0.344
,
0.417
,
0.917
,
1.178
)
)
)
expect_equal
(
new
,
reference
,
tolerance
=
1e-5
)
expect_equal
(
new
,
reference
)
# diverse concentration_b and custom survival_max
# diverse concentration_b and custom survival_max
new
<-
multi_tox
(
new
<-
multi_tox
(
...
@@ -82,17 +84,18 @@ test_that("results have not changed", {
...
@@ -82,17 +84,18 @@ test_that("results have not changed", {
0.7
,
0.7
,
42
42
)
)
new
<-
round
(
new
,
3
)
reference
<-
data.frame
(
reference
<-
data.frame
(
concentration_a
=
c
(
0
,
0.01
,
0.1
,
1
,
7
,
15
),
concentration_a
=
c
(
0
,
0.01
,
0.1
,
1
,
7
,
15
),
concentration_b
=
c
(
0
,
0.02
,
0.2
,
2
,
14
,
30
),
concentration_b
=
c
(
0
,
0.02
,
0.2
,
2
,
14
,
30
),
survival
=
c
(
37.073
3321
,
33.58
391933
,
32.826
1419
,
2.763599e+01
,
1.621905e-01
,
0
),
survival
=
c
(
37.073
,
33.58
4
,
32.826
,
27.636
,
0.162
,
0
),
stress_tox_sa
=
c
(
0
,
0.07
567745
,
0.1807501
,
4.510696e-01
,
9.961584e-01
,
1.294
227
),
stress_tox_sa
=
c
(
0
,
0.07
6
,
0.181
,
0.451
,
0.996
,
1.294
),
stress_tox_ca
=
c
(
0
,
0.05
654834
,
0.134
3429
,
3
.3
67461e-01
,
7.321990e-01
,
9.063311e-01
),
stress_tox_ca
=
c
(
0
,
0.05
7
,
0.134
,
0
.3
37
,
0.732
,
0.906
),
stress_tox
=
c
(
0
,
0.0
6993872
,
0.1668279
,
4.167725e-01
,
9.169706e-01
,
1.17
785
8
),
stress_tox
=
c
(
0
,
0.0
7
,
0.167
,
0.417
,
0.917
,
1.178
),
sys
=
c
(
0.2
698033
,
0.262
48944
,
0.177
4490
,
1.829786e-04
,
0
,
0
),
sys
=
c
(
0.2
7
,
0.262
,
0.177
,
0
,
0
,
0
),
stress_total
=
c
(
0.2
698033
,
0.332
42815
,
0.344
2769
,
4.169555e-01
,
9.169706e-01
,
1.17
785
8
)
stress_total
=
c
(
0.2
7
,
0.332
,
0.344
,
0.417
,
0.917
,
1.178
)
)
)
expect_equal
(
new
,
reference
,
tolerance
=
1e-5
)
expect_equal
(
new
,
reference
)
})
})
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment