diff --git a/tests/testthat/test-Zalpha.R b/tests/testthat/test-Zalpha.R index e9f72c656392839e7f498194206f0d3fb7d9a20a..9bbe756dbba239e2a633074a7bf44aa4ed6b426c 100644 --- a/tests/testthat/test-Zalpha.R +++ b/tests/testthat/test-Zalpha.R @@ -27,7 +27,7 @@ test_that("Zalpha calculates Zalpha statistic correctly", { ((13+97/144)/36+(1+121/144)/10)/2, ((15+25/48)/45+(1+55/144)/6)/2, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with a different window size @@ -44,7 +44,7 @@ test_that("Zalpha calculates Zalpha statistic correctly with a different window ((2+3/16)/10+(2+7/144)/10)/2, ((2+3/16)/10+(1+121/144)/10)/2, NA,NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with a character matrix as x @@ -66,7 +66,7 @@ test_that("Zalpha calculates Zalpha statistic correctly with character matrix", ((13+97/144)/36+(1+121/144)/10)/2, ((15+25/48)/45+(1+55/144)/6)/2, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with X supplied as a parameter @@ -79,7 +79,7 @@ test_that("Zalpha calculates Zalpha statistic correctly with X supplied", { Zalpha=c(((7+31/72)/15+(7+13/48)/28)/2, ((8+17/144)/21+(4+7/16)/21)/2, ((9+131/144)/28+(2+13/16)/15)/2) - )) + ),tolerance=0.0001) }) ## Test the function with X supplied as a parameter outside of the region defined in pos @@ -235,5 +235,5 @@ test_that("Zalpha calculates Zalpha statistic correctly with missing value", { 0.322897376543210, 0.360532407407407, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) diff --git a/tests/testthat/test-Zalpha_BetaCDF.R b/tests/testthat/test-Zalpha_BetaCDF.R index a97c42e8082d5771f1f5582552b483512af9c370..81f6b271a6f813c4953faa618a230240812abe4b 100644 --- a/tests/testthat/test-Zalpha_BetaCDF.R +++ b/tests/testthat/test-Zalpha_BetaCDF.R @@ -48,7 +48,7 @@ test_that("Zalpha_BetaCDF calculates Zalpha_BetaCDF statistic correctly", { 0.396797658473664, 0.393583363498442, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with a different window size @@ -65,7 +65,7 @@ test_that("Zalpha_BetaCDF calculates Zalpha_BetaCDF statistic correctly with a d 0.325273987256311, 0.319208662374142, NA,NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with a character matrix as x @@ -86,7 +86,7 @@ test_that("Zalpha_BetaCDF calculates Zalpha_BetaCDF statistic correctly with cha 0.396797658473664, 0.393583363498442, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with X supplied as a parameter @@ -99,7 +99,7 @@ test_that("Zalpha_BetaCDF calculates Zalpha_BetaCDF statistic correctly with X s Zalpha_BetaCDF=c(0.461984646273587, 0.409097872871755, 0.388665184297966) - )) + ),tolerance=0.0001) }) ## Test the function with X supplied as a parameter outside of the region defined in pos @@ -330,5 +330,5 @@ test_that("Zalpha_BetaCDF calculates Zalpha_BetaCDF statistic correctly with mis 0.431252209159130, 0.453835332399716, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) diff --git a/tests/testthat/test-Zalpha_Zscore.R b/tests/testthat/test-Zalpha_Zscore.R index 22cddb01881a9a027581da769de5bd23db6091fb..a018afa248583bc2cf319224814091ec31a138de 100644 --- a/tests/testthat/test-Zalpha_Zscore.R +++ b/tests/testthat/test-Zalpha_Zscore.R @@ -47,7 +47,7 @@ test_that("Zalpha_Zscore calculates Zalpha_Zscore statistic correctly", { -0.285401890680237, -0.270109843273656, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with a different window size @@ -64,7 +64,7 @@ test_that("Zalpha_Zscore calculates Zalpha_Zscore statistic correctly with a dif -0.507186471020645, -0.535949238344209, NA,NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with a character matrix as x @@ -85,7 +85,7 @@ test_that("Zalpha_Zscore calculates Zalpha_Zscore statistic correctly with chara -0.285401890680237, -0.270109843273656, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with X supplied as a parameter @@ -98,7 +98,7 @@ test_that("Zalpha_Zscore calculates Zalpha_Zscore statistic correctly with X sup Zalpha_Zscore=c(-0.038223960672508, -0.240917156668399, -0.316679396483571) - )) + ),tolerance=0.0001) }) ## Test the function with X supplied as a parameter outside of the region defined in pos @@ -349,5 +349,5 @@ test_that("Zalpha_Zscore calculates Zalpha_Zscore statistic correctly with missi -0.1850465883763240, -0.0912782685815102, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) diff --git a/tests/testthat/test-Zalpha_all.R b/tests/testthat/test-Zalpha_all.R index 90f6ab3ac8f060b6636a5925dcc6cd9a83c33698..13ec986fb35a76f0811dae6a35ad5ec2bea023c1 100644 --- a/tests/testthat/test-Zalpha_all.R +++ b/tests/testthat/test-Zalpha_all.R @@ -73,7 +73,7 @@ test_that("Zalpha_all calculates statistics correctly", { Zbeta_Zscore=c(NA,NA,NA,NA,-0.249622295287423,-0.298443278340203,-0.303226918699104,-0.278319517790552,-0.324158658191404,-0.298557987824230,-0.278980061934724,NA,NA,NA,NA), Zalpha_BetaCDF=c(NA,NA,NA,NA,0.498582271149287,0.525043954366501,0.461984646273587,0.409097872871755,0.388665184297966,0.396797658473664,0.393583363498442,NA,NA,NA,NA), Zbeta_BetaCDF=c(NA,NA,NA,NA,0.418016604924725,0.406297914560424,0.401067078642937,0.410829577389033,0.397509236264354,0.405347850057668,0.409781300588220,NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with a different window size @@ -97,7 +97,7 @@ test_that("Zalpha_all calculates the statistics correctly with a different windo Zbeta_Zscore=c(NA,NA,NA,NA,NA,-0.209270924830470,-0.410246297817478,-0.344123580516901,-0.308094601136825,-0.264295466759451,NA,NA,NA,NA,NA), Zalpha_BetaCDF=c(NA,NA,NA,NA,NA,0.504981991655003,0.459025835290601,0.371462610998979,0.325273987256311,0.319208662374142,NA,NA,NA,NA,NA), Zbeta_BetaCDF=c(NA,NA,NA,NA,NA,0.422727696221137,0.368571388831177,0.391643594518566,0.398259343601550,0.408526848230388,NA,NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with a character matrix as x @@ -124,7 +124,7 @@ test_that("Zalpha_all calculates all statistics correctly with character matrix" Zbeta_Zscore=c(NA,NA,NA,NA,-0.249622295287423,-0.298443278340203,-0.303226918699104,-0.278319517790552,-0.324158658191404,-0.298557987824230,-0.278980061934724,NA,NA,NA,NA), Zalpha_BetaCDF=c(NA,NA,NA,NA,0.498582271149287,0.525043954366501,0.461984646273587,0.409097872871755,0.388665184297966,0.396797658473664,0.393583363498442,NA,NA,NA,NA), Zbeta_BetaCDF=c(NA,NA,NA,NA,0.418016604924725,0.406297914560424,0.401067078642937,0.410829577389033,0.397509236264354,0.405347850057668,0.409781300588220,NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with X supplied as a parameter @@ -148,7 +148,7 @@ test_that("Zalpha_all calculates the statistics correctly with X supplied", { Zbeta_Zscore=c(-0.303226918699104,-0.278319517790552,-0.324158658191404), Zalpha_BetaCDF=c(0.461984646273587,0.409097872871755,0.388665184297966), Zbeta_BetaCDF=c(0.401067078642937,0.410829577389033,0.397509236264354) - )) + ),tolerance=0.0001) }) ## Test the function with X supplied as a parameter outside of the region defined in pos @@ -431,7 +431,7 @@ test_that("Zalpha_all calculates statistics correctly with only x supplied", { L_plus_R=c(NA,NA,NA,NA,51,46,43,42,43,46,51,NA,NA,NA,NA), Zalpha=c(NA,NA,NA,NA,((3+1/2)/6+(11+41/144)/45)/2,((6+1/4)/10+(9+41/48)/36)/2,((7+31/72)/15+(7+13/48)/28)/2,((8+17/144)/21+(4+7/16)/21)/2,((9+131/144)/28+(2+13/16)/15)/2,((13+97/144)/36+(1+121/144)/10)/2,((15+25/48)/45+(1+55/144)/6)/2,NA,NA,NA,NA), Zbeta=c(NA,NA,NA,NA,(10+5/18)/40,(10+35/36)/45,(11+103/144)/48,(12+73/144)/49,(11+83/144)/48,(11+17/48)/45,(10+65/144)/40,NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## test that only the relevant statistics are calculated with dist, LDprofile_bins and _rsq supplied @@ -445,7 +445,7 @@ test_that("Zalpha_all calculates statistics correctly with dist, LDprofile_bins L_plus_R=c(NA,NA,NA,NA,51,46,43,42,43,46,51,NA,NA,NA,NA), Zalpha_expected=c(NA,NA,NA,NA,0.390457304338967,0.392014054942343,0.397339546324536,0.398874728980465,0.400715520018796,0.401718327864356,0.399526703832832,NA,NA,NA,NA), Zbeta_expected=c(NA,NA,NA,NA,0.350404001770323,0.357372168444253,0.360647397851440,0.361951221318345,0.362988750761055,0.364752550557575,0.366343120440209,NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## test that only the relevant statistics are calculated with x, dist, LDprofile_bins and _rsq supplied @@ -465,7 +465,7 @@ test_that("Zalpha_all calculates statistics correctly with x, dist, LDprofile_bi Zalpha_log_rsq_over_expected=c(NA,NA,NA,NA, -0.129685954728232, -0.086676970494806,-0.207059296326176, -0.317561061974900, -0.355497049708911, -0.345346264723395, -0.340516242835506,NA,NA,NA,NA), Zbeta_rsq_over_expected=c(NA,NA,NA,NA,0.741001103918817,0.693986983022872,0.691113499222754,0.716092979819490,0.663090587779225,0.690647913157800,0.710787633520743,NA,NA,NA,NA), Zbeta_log_rsq_over_expected=c(NA,NA,NA,NA,-0.310756050486805,-0.323333602724241,-0.349639186187507,-0.339617245857445,-0.355799393664026,-0.313469388842524,-0.304918066115218,NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## test that only the relevant statistics are calculated with only LDprofile_Beta_a and _b not supplied @@ -487,7 +487,7 @@ test_that("Zalpha_all calculates statistics correctly with only LDprofile_Beta_a Zbeta_log_rsq_over_expected=c(NA,NA,NA,NA,-0.310756050486805,-0.323333602724241,-0.349639186187507,-0.339617245857445,-0.355799393664026,-0.313469388842524,-0.304918066115218,NA,NA,NA,NA), Zalpha_Zscore=c(NA,NA,NA,NA,0.083669516080429,0.160231324773080,-0.038223960672508,-0.240917156668399,-0.316679396483571,-0.285401890680237,-0.270109843273656,NA,NA,NA,NA), Zbeta_Zscore=c(NA,NA,NA,NA,-0.249622295287423,-0.298443278340203,-0.303226918699104,-0.278319517790552,-0.324158658191404,-0.298557987824230,-0.278980061934724,NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## test that only the relevant statistics are calculated with only LDprofile_sd not supplied @@ -509,7 +509,7 @@ test_that("Zalpha_all calculates statistics correctly with only LDprofile_sd not Zbeta_log_rsq_over_expected=c(NA,NA,NA,NA,-0.310756050486805,-0.323333602724241,-0.349639186187507,-0.339617245857445,-0.355799393664026,-0.313469388842524,-0.304918066115218,NA,NA,NA,NA), Zalpha_BetaCDF=c(NA,NA,NA,NA,0.498582271149287,0.525043954366501,0.461984646273587,0.409097872871755,0.388665184297966,0.396797658473664,0.393583363498442,NA,NA,NA,NA), Zbeta_BetaCDF=c(NA,NA,NA,NA,0.418016604924725,0.406297914560424,0.401067078642937,0.410829577389033,0.397509236264354,0.405347850057668,0.409781300588220,NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## test that only the relevant statistics are calculated with x not supplied @@ -523,7 +523,7 @@ test_that("Zalpha_all calculates statistics correctly with only x not supplied", L_plus_R=c(NA,NA,NA,NA,51,46,43,42,43,46,51,NA,NA,NA,NA), Zalpha_expected=c(NA,NA,NA,NA,0.390457304338967,0.392014054942343,0.397339546324536,0.398874728980465,0.400715520018796,0.401718327864356,0.399526703832832,NA,NA,NA,NA), Zbeta_expected=c(NA,NA,NA,NA,0.350404001770323,0.357372168444253,0.360647397851440,0.361951221318345,0.362988750761055,0.364752550557575,0.366343120440209,NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## test that only the relevant statistics are calculated with dist not supplied @@ -537,7 +537,7 @@ test_that("Zalpha_all calculates statistics correctly with dist not supplied", { L_plus_R=c(NA,NA,NA,NA,51,46,43,42,43,46,51,NA,NA,NA,NA), Zalpha=c(NA,NA,NA,NA,((3+1/2)/6+(11+41/144)/45)/2,((6+1/4)/10+(9+41/48)/36)/2,((7+31/72)/15+(7+13/48)/28)/2,((8+17/144)/21+(4+7/16)/21)/2,((9+131/144)/28+(2+13/16)/15)/2,((13+97/144)/36+(1+121/144)/10)/2,((15+25/48)/45+(1+55/144)/6)/2,NA,NA,NA,NA), Zbeta=c(NA,NA,NA,NA,(10+5/18)/40,(10+35/36)/45,(11+103/144)/48,(12+73/144)/49,(11+83/144)/48,(11+17/48)/45,(10+65/144)/40,NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## test that only the relevant statistics are calculated with LDprofile_bins not supplied @@ -551,7 +551,7 @@ test_that("Zalpha_all calculates statistics correctly with LDprofile_bins not su L_plus_R=c(NA,NA,NA,NA,51,46,43,42,43,46,51,NA,NA,NA,NA), Zalpha=c(NA,NA,NA,NA,((3+1/2)/6+(11+41/144)/45)/2,((6+1/4)/10+(9+41/48)/36)/2,((7+31/72)/15+(7+13/48)/28)/2,((8+17/144)/21+(4+7/16)/21)/2,((9+131/144)/28+(2+13/16)/15)/2,((13+97/144)/36+(1+121/144)/10)/2,((15+25/48)/45+(1+55/144)/6)/2,NA,NA,NA,NA), Zbeta=c(NA,NA,NA,NA,(10+5/18)/40,(10+35/36)/45,(11+103/144)/48,(12+73/144)/49,(11+83/144)/48,(11+17/48)/45,(10+65/144)/40,NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## test that Zalpha_all works with a missing value @@ -566,5 +566,5 @@ test_that("Zalpha_all calculates statistics correctly with missing value", { L_plus_R=c(NA,NA,NA,NA,51,46,43,42,43,46,51,NA,NA,NA,NA), Zalpha=c(NA,NA,NA,NA,0.434953703703704,0.473283179012346,0.397114748677249,0.317791005291005,0.300801917989418,0.322897376543210,0.360532407407407,NA,NA,NA,NA), Zbeta=c(NA,NA,NA,NA,0.248611111111111,0.235185185185185,0.233651620370370,0.257794784580499,0.250144675925926,0.259413580246914,0.271354166666667,NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) diff --git a/tests/testthat/test-Zalpha_expected.R b/tests/testthat/test-Zalpha_expected.R index 226e2ca2d06ed70633f2c9456a78f2f25edfdbc1..635c5fe8dbc2f4f25b9233b45cf19586ffe41ee9 100644 --- a/tests/testthat/test-Zalpha_expected.R +++ b/tests/testthat/test-Zalpha_expected.R @@ -36,7 +36,7 @@ test_that("Zalpha_expected calculates Zalpha_expected statistic correctly", { 0.401718327864356, 0.399526703832832, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with a different window size @@ -53,7 +53,7 @@ test_that("Zalpha_expected calculates Zalpha_expected statistic correctly with a 0.419512588688985, 0.421536156959405, NA,NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with X supplied as a parameter @@ -66,7 +66,7 @@ test_that("Zalpha_expected calculates Zalpha_expected statistic correctly with X Zalpha_expected=c(0.397339546324536, 0.398874728980465, 0.400715520018796) - )) + ),tolerance=0.0001) }) ## Test the function with X supplied as a parameter outside of the region defined in pos diff --git a/tests/testthat/test-Zalpha_log_rsq_over_expected.R b/tests/testthat/test-Zalpha_log_rsq_over_expected.R index 5f6cb0d7bd30e79f075c72f9a9ea10df3f047ba8..b05466d89281ba3fdcaaec5c5fdb77501623fd26 100644 --- a/tests/testthat/test-Zalpha_log_rsq_over_expected.R +++ b/tests/testthat/test-Zalpha_log_rsq_over_expected.R @@ -37,7 +37,7 @@ test_that("Zalpha_log_rsq_over_expected calculates Zalpha_log_rsq_over_expected -0.345346264723395, -0.340516242835506, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with a different window size @@ -54,7 +54,7 @@ test_that("Zalpha_log_rsq_over_expected calculates Zalpha_log_rsq_over_expected -0.432639322094622, -0.477272952569813, NA,NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with a character matrix as x @@ -75,7 +75,7 @@ test_that("Zalpha_log_rsq_over_expected calculates Zalpha_log_rsq_over_expected -0.345346264723395, -0.340516242835506, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with X supplied as a parameter @@ -88,7 +88,7 @@ test_that("Zalpha_log_rsq_over_expected calculates Zalpha_log_rsq_over_expected Zalpha_log_rsq_over_expected=c(-0.207059296326176, -0.317561061974900, -0.355497049708911) - )) + ),tolerance=0.0001) }) ## Test the function with X supplied as a parameter outside of the region defined in pos @@ -323,5 +323,5 @@ test_that("Zalpha_log_rsq_over_expected calculates Zalpha_log_rsq_over_expected -0.2876978917129680, -0.2297613495634870, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) diff --git a/tests/testthat/test-Zalpha_rsq_over_expected.R b/tests/testthat/test-Zalpha_rsq_over_expected.R index 162cc286782c208a994bef20cd054c7eda4e5064..634c5ffb5ebb360d19b0e0cc960d379aee2fdad1 100644 --- a/tests/testthat/test-Zalpha_rsq_over_expected.R +++ b/tests/testthat/test-Zalpha_rsq_over_expected.R @@ -37,7 +37,7 @@ test_that("Zalpha_rsq_over_expected calculates Zalpha_rsq_over_expected statisti 0.728230393808371, 0.737847444047460, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with a different window size @@ -54,7 +54,7 @@ test_that("Zalpha_rsq_over_expected calculates Zalpha_rsq_over_expected statisti 0.499640647493653, 0.478776705516631, NA,NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with a character matrix as x @@ -75,7 +75,7 @@ test_that("Zalpha_rsq_over_expected calculates Zalpha_rsq_over_expected statisti 0.728230393808371, 0.737847444047460, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with X supplied as a parameter @@ -88,7 +88,7 @@ test_that("Zalpha_rsq_over_expected calculates Zalpha_rsq_over_expected statisti Zalpha_rsq_over_expected=c(0.973208670564282, 0.767152145198758, 0.691051112331195) - )) + ),tolerance=0.0001) }) ## Test the function with X supplied as a parameter outside of the region defined in pos @@ -323,5 +323,5 @@ test_that("Zalpha_rsq_over_expected calculates Zalpha_rsq_over_expected statisti 0.823237169574888, 0.907695973532459, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) diff --git a/tests/testthat/test-Zbeta.R b/tests/testthat/test-Zbeta.R index e71bcaf2356f628551274fbb6a324a3e57c4319a..7a1889622f9d340a582c751ebd5ffa12ec2909be 100644 --- a/tests/testthat/test-Zbeta.R +++ b/tests/testthat/test-Zbeta.R @@ -27,7 +27,7 @@ test_that("Zbeta calculates Zbeta statistic correctly", { (11+17/48)/45, (10+65/144)/40, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with a different window size @@ -44,7 +44,7 @@ test_that("Zbeta calculates Zbeta statistic correctly with a different window si (6+101/144)/25, (7+17/144)/25, NA,NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with a character matrix as x @@ -66,7 +66,7 @@ test_that("Zbeta calculates Zbeta statistic correctly with character matrix", { (11+17/48)/45, (10+65/144)/40, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with X supplied as a parameter @@ -79,7 +79,7 @@ test_that("Zbeta calculates Zbeta statistic correctly with X supplied", { Zbeta=c((11+103/144)/48, (12+73/144)/49, (11+83/144)/48) - )) + ),tolerance=0.0001) }) ## Test the function with X supplied as a parameter outside of the region defined in pos @@ -234,5 +234,5 @@ test_that("Zbeta calculates Zbeta statistic correctly with missing value", { 0.259413580246914, 0.271354166666667, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) diff --git a/tests/testthat/test-Zbeta_BetaCDF.R b/tests/testthat/test-Zbeta_BetaCDF.R index 56de2d30e1a9d14889f44f28811b3e1e72910963..580d35e85232461b8eb17c6752db2d4c1512f8b9 100644 --- a/tests/testthat/test-Zbeta_BetaCDF.R +++ b/tests/testthat/test-Zbeta_BetaCDF.R @@ -48,7 +48,7 @@ test_that("Zbeta_BetaCDF calculates Zbeta_BetaCDF statistic correctly", { 0.405347850057668, 0.409781300588220, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with a different window size @@ -65,7 +65,7 @@ test_that("Zbeta_BetaCDF calculates Zbeta_BetaCDF statistic correctly with a dif 0.398259343601550, 0.408526848230388, NA,NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with a character matrix as x @@ -86,7 +86,7 @@ test_that("Zbeta_BetaCDF calculates Zbeta_BetaCDF statistic correctly with chara 0.405347850057668, 0.409781300588220, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with X supplied as a parameter @@ -99,7 +99,7 @@ test_that("Zbeta_BetaCDF calculates Zbeta_BetaCDF statistic correctly with X sup Zbeta_BetaCDF=c(0.401067078642937, 0.410829577389033, 0.397509236264354) - )) + ),tolerance=0.0001) }) ## Test the function with X supplied as a parameter outside of the region defined in pos @@ -330,5 +330,5 @@ test_that("Zbeta_BetaCDF calculates Zbeta_BetaCDF statistic correctly with missi 0.414765530721706, 0.422608554537899, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) diff --git a/tests/testthat/test-Zbeta_Zscore.R b/tests/testthat/test-Zbeta_Zscore.R index 9b79635e23be0255b1b54d19e4244d4c3b112a51..b1ef29d51cc8e8a6bf4c1aa38a4ade1b883e264a 100644 --- a/tests/testthat/test-Zbeta_Zscore.R +++ b/tests/testthat/test-Zbeta_Zscore.R @@ -47,7 +47,7 @@ test_that("Zbeta_Zscore calculates Zbeta_Zscore statistic correctly", { -0.298557987824230, -0.278980061934724, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with a different window size @@ -64,7 +64,7 @@ test_that("Zbeta_Zscore calculates Zbeta_Zscore statistic correctly with a diffe -0.308094601136825, -0.264295466759451, NA,NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with a character matrix as x @@ -85,7 +85,7 @@ test_that("Zbeta_Zscore calculates Zbeta_Zscore statistic correctly with charact -0.298557987824230, -0.278980061934724, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with X supplied as a parameter @@ -349,5 +349,5 @@ test_that("Zbeta_Zscore calculates Zbeta_Zscore statistic correctly with missing -0.280921980725937, -0.253883231792888, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) diff --git a/tests/testthat/test-Zbeta_expected.R b/tests/testthat/test-Zbeta_expected.R index d81660310e1f45049b7ca3c311b68a877b904ee1..8a499b8b77513da8d53d2cc0411b7fd4d3a09390 100644 --- a/tests/testthat/test-Zbeta_expected.R +++ b/tests/testthat/test-Zbeta_expected.R @@ -36,7 +36,7 @@ test_that("Zbeta_expected calculates Zbeta_expected statistic correctly", { 0.364752550557575, 0.366343120440209, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with a different window size @@ -53,7 +53,7 @@ test_that("Zbeta_expected calculates Zbeta_expected statistic correctly with a d 0.388272359451172, 0.387629142774876, NA,NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with X supplied as a parameter @@ -66,7 +66,7 @@ test_that("Zbeta_expected calculates Zbeta_expected statistic correctly with X s Zbeta_expected=c(0.360647397851440, 0.361951221318345, 0.362988750761055) - )) + ),tolerance=0.0001) }) ## Test the function with X supplied as a parameter outside of the region defined in pos diff --git a/tests/testthat/test-Zbeta_log_rsq_over_expected.R b/tests/testthat/test-Zbeta_log_rsq_over_expected.R index 98f67fdbad8e5a78d40cfd025febd7e85013987f..d7f841ec3097adb97dd0183fd7459ab21f767355 100644 --- a/tests/testthat/test-Zbeta_log_rsq_over_expected.R +++ b/tests/testthat/test-Zbeta_log_rsq_over_expected.R @@ -37,7 +37,7 @@ test_that("Zbeta_log_rsq_over_expected calculates Zbeta_log_rsq_over_expected st -0.313469388842524, -0.304918066115218, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with a different window size @@ -54,7 +54,7 @@ test_that("Zbeta_log_rsq_over_expected calculates Zbeta_log_rsq_over_expected st -0.364550829001460, -0.315576925527679, NA,NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with a character matrix as x @@ -75,7 +75,7 @@ test_that("Zbeta_log_rsq_over_expected calculates Zbeta_log_rsq_over_expected st -0.313469388842524, -0.304918066115218, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with X supplied as a parameter @@ -88,7 +88,7 @@ test_that("Zbeta_log_rsq_over_expected calculates Zbeta_log_rsq_over_expected st Zbeta_log_rsq_over_expected=c(-0.349639186187507, -0.339617245857445, -0.355799393664026) - )) + ),tolerance=0.0001) }) ## Test the function with X supplied as a parameter outside of the region defined in pos @@ -323,5 +323,5 @@ test_that("Zbeta_log_rsq_over_expected calculates Zbeta_log_rsq_over_expected st -0.302866694293198, -0.277938534964028, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) diff --git a/tests/testthat/test-Zbeta_rsq_over_expected.R b/tests/testthat/test-Zbeta_rsq_over_expected.R index d2c6ec06d228e14f23be88ae2abbb3da2b352e71..5020ba48f8cdef5223f8ff60488b08010f0df991 100644 --- a/tests/testthat/test-Zbeta_rsq_over_expected.R +++ b/tests/testthat/test-Zbeta_rsq_over_expected.R @@ -37,7 +37,7 @@ test_that("Zbeta_rsq_over_expected calculates Zbeta_rsq_over_expected statistic 0.690647913157800, 0.710787633520743, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with a different window size @@ -54,7 +54,7 @@ test_that("Zbeta_rsq_over_expected calculates Zbeta_rsq_over_expected statistic 0.686521835223347, 0.732759533350118, NA,NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with a character matrix as x @@ -75,7 +75,7 @@ test_that("Zbeta_rsq_over_expected calculates Zbeta_rsq_over_expected statistic 0.690647913157800, 0.710787633520743, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) ## Test the function with X supplied as a parameter @@ -88,7 +88,7 @@ test_that("Zbeta_rsq_over_expected calculates Zbeta_rsq_over_expected statistic Zbeta_rsq_over_expected=c(0.691113499222754, 0.716092979819490, 0.663090587779225) - )) + ),tolerance=0.0001) }) ## Test the function with X supplied as a parameter outside of the region defined in pos @@ -323,5 +323,5 @@ test_that("Zbeta_rsq_over_expected calculates Zbeta_rsq_over_expected statistic 0.708332106873554, 0.735944021838047, NA,NA,NA,NA) - )) + ),tolerance=0.0001) }) diff --git a/tests/testthat/test-create_LDprofile.R b/tests/testthat/test-create_LDprofile.R index 5cdf3f3e50a83b48ac0df0d6abe6ff6c91d3f11f..5bb46a23bfd52513b82b15cc087e961f3b643e1a 100644 --- a/tests/testthat/test-create_LDprofile.R +++ b/tests/testthat/test-create_LDprofile.R @@ -21,7 +21,7 @@ test_that("create_LDprofile calculates the LD profile correctly", { Beta_a=c(0.619957744381906,1.125028692019340,0.635410044952769,3.941019442363900,NA), Beta_b=c(1.062459890834270,2.446706389704430,1.149319432462400,8.454825333760550,NA), n=c(54,31,15,5,0) - )) + ),tolerance=0.0001) }) ## Test the function with a different max_dist @@ -36,7 +36,7 @@ test_that("create_LDprofile calculates the LD profile correctly with a different Beta_a=c(0.619957744381906,1.125028692019340,0.635410044952769), Beta_b=c(1.062459890834270,2.446706389704430,1.149319432462400), n=c(54,31,15) - )) + ),tolerance=0.0001) }) ## Test the function with no max_dist given @@ -50,7 +50,7 @@ test_that("create_LDprofile calculates the LD profile correctly with no max_dist Beta_a=c(0.619957744381906,1.125028692019340,0.635410044952769,3.941019442363900), Beta_b=c(1.062459890834270,2.446706389704430,1.149319432462400,8.454825333760550), n=c(54,31,15,5) - )) + ),tolerance=0.0001) }) @@ -66,7 +66,7 @@ test_that("create_LDprofile calculates the LD profile correctly with a different Beta_a=c(0.916070145958307,0.637072700079744,1.046576044485340,1.909812912830260,0.775059123115346,1.088198634018290,3.789877096116000,NA), Beta_b=c(2.326350552394540,0.872215477086822,2.166981335251990,5.166454170350760,1.748740564135290,1.488374161884570,9.367197007381050,NA), n=c(29,25,22,9,10,5,4,1) - )) + ),tolerance=0.0001) }) ## Test the function with beta_params not specified @@ -81,7 +81,7 @@ test_that("create_LDprofile calculates the LD profile correctly with beta_params Beta_a=c(NA,NA,NA,NA,NA), Beta_b=c(NA,NA,NA,NA,NA), n=c(54,31,15,5,0) - )) + ),tolerance=0.0001) }) ## Test the function with a character matrix as x @@ -99,7 +99,7 @@ test_that("create_LDprofile calculates the LD profile correctly with character m Beta_a=c(0.619957744381906,1.125028692019340,0.635410044952769,3.941019442363900,NA), Beta_b=c(1.062459890834270,2.446706389704430,1.149319432462400,8.454825333760550,NA), n=c(54,31,15,5,0) - )) + ),tolerance=0.0001) }) ## Test all the checks @@ -219,7 +219,7 @@ test_that("create_LDprofile calculates the LD profile correctly with missing val Beta_a=c(0.606846782972070,0.932888189465068,0.616307318328496,4.643089841249520,NA), Beta_b=c(0.942600409939103,1.692309859072240,1.139111486418360,11.012925076592600,NA), n=c(54,31,15,5,0) - )) + ),tolerance=0.0001) }) ## Test the function with missing value in dist @@ -235,7 +235,7 @@ test_that("create_LDprofile calculates the LD profile correctly with missing val Beta_a=c(0.634602938184746,1.570771368863860,0.611627386753874,3.941019442363900,NA), Beta_b=c(1.133751642734910,4.401600723631340,1.116161049339830,8.454825333760550,NA), n=c(45,27,14,5,0) - )) + ),tolerance=0.0001) })