From f6a1724b9fb671fd15314a5823afbf6e2cbcf692 Mon Sep 17 00:00:00 2001 From: fredjaya Date: Fri, 24 Nov 2023 17:17:34 +1100 Subject: [PATCH] Add tests to improve optimise_prevalence.R cover. Fix (temporary) catch for interval in optimise_s_prevalence(). --- .Rbuildignore | 2 +- CHANGELOG.md | 3 +- R/fisher_information.R | 2 +- R/optimise_prevalence.R | 8 +- {dependencies => dev_resources}/README.md | 0 dev_resources/cov.csv | 290 ++++++++++++++++++++++ dev_resources/coverage.csv | 290 ++++++++++++++++++++++ {dependencies => dev_resources}/dep.png | Bin man/hello.Rd | 12 - tests/testthat/test-design_effect.R | 11 + tests/testthat/test-optimise_prevalence.R | 70 +++++- tests/testthat/test-util.R | 11 + 12 files changed, 679 insertions(+), 20 deletions(-) rename {dependencies => dev_resources}/README.md (100%) create mode 100644 dev_resources/cov.csv create mode 100644 dev_resources/coverage.csv rename {dependencies => dev_resources}/dep.png (100%) delete mode 100644 man/hello.Rd create mode 100644 tests/testthat/test-util.R diff --git a/.Rbuildignore b/.Rbuildignore index ffee759..a6f9627 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -6,7 +6,7 @@ ^Figures* man/hello.Rd ^LICENSE\.md$ -dependencies/ +^dev_resources/$ ^\.github$ ^PoolPoweR\.Rproj$ ^CHANGELOG.md$ diff --git a/CHANGELOG.md b/CHANGELOG.md index d8503ef..9c86db7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,8 +23,8 @@ and this project adheres to **Focus:** Package - [ ] Fix integrand issue - [ ] Implement codecov.io +- [ ] Refactor functions (i.e. break down into smaller ones for readability) - [ ] Configure and optimise GHA workflows -- [ ] Refer to package and tidyverse guides for coherency and note rooms for improvement ### [v0.0.3] **Focus:** Documentation @@ -32,6 +32,7 @@ and this project adheres to - [ ] Rename interval [#13](https://github.com/AngusMcLure/PoolPoweR/issues/13) - [ ] Update docs with cluster and non-cluster cases [#14](https://github.com/AngusMcLure/PoolPoweR/issues/14) +- [ ] Add PoolPoweR-package.R (#18) - [x] Rename real.scale to real_scale ### [v0.0.2] - 2023-12-01 diff --git a/R/fisher_information.R b/R/fisher_information.R index b643ef2..795ba57 100644 --- a/R/fisher_information.R +++ b/R/fisher_information.R @@ -305,7 +305,7 @@ fi_pool_cluster <- function(pool_size, prod(choose(N, y)) }) } - } + } ## End for form == "beta" tol <- 1e-5 if (abs(sum(lik) - 1) > tol || abs(sum(lik_theta)) > tol || diff --git a/R/optimise_prevalence.R b/R/optimise_prevalence.R index 003c4ea..9aa933e 100644 --- a/R/optimise_prevalence.R +++ b/R/optimise_prevalence.R @@ -78,6 +78,8 @@ optimise_s_prevalence <- function(pool_number = 1, respect to s often has mulitple minima and therefore the discrete distribution is not currently supported for optimisation') } + if (interval < 0) stop("interval must be 0 or higher") + invalid_cost <- FALSE # trigger for when costs are infinite to ensure that there's no cost output in these cases # print(c(theta = prevalence, sens = sensitivity, spec = specificity, unit = cost_unit, test = cost_pool, location =cost_cluster , rho = correlation, N = N, form = form, max_s = max_s)) @@ -173,8 +175,6 @@ optimise_s_prevalence <- function(pool_number = 1, cost_interval = cost_interval, catch_interval = N * c(lower, upper) ) - } else { - stop("interval must be between 0 and 1.") } out } @@ -219,10 +219,10 @@ optimise_sN_prevalence <- function(prevalence, } opt$N <- Nopt if (opt$N == max_N) { - warning("Maximum cost effectivness is achieved at or above the maximum number of pools allowed. Consider increasing max.N") + warning("Maximum cost effectivness is achieved at or above the maximum number of pools allowed. Consider increasing max_N") } if (opt$s == max_s) { - warning("Maximum cost effectivness is achieved at or above the maximum size of pools allowed. Consider increasing max.s") + warning("Maximum cost effectivness is achieved at or above the maximum size of pools allowed. Consider increasing max_s") } } diff --git a/dependencies/README.md b/dev_resources/README.md similarity index 100% rename from dependencies/README.md rename to dev_resources/README.md diff --git a/dev_resources/cov.csv b/dev_resources/cov.csv new file mode 100644 index 0000000..485cf45 --- /dev/null +++ b/dev_resources/cov.csv @@ -0,0 +1,290 @@ +"","filename","functions","first_line","first_byte","last_line","last_byte","first_column","last_column","first_parsed","last_parsed","value" +"1","R/design_effect.R","design_effect",56,3,60,11,3,11,58,62,4 +"2","R/fisher_information.R","fi_pool",55,3,55,16,3,16,119,119,343 +"3","R/fisher_information.R","fi_pool",56,3,56,21,3,21,120,120,343 +"4","R/fisher_information.R","fi_pool",57,3,57,23,3,23,121,121,343 +"5","R/fisher_information.R","fi_pool",58,3,58,20,3,20,122,122,343 +"6","R/fisher_information.R","fi_pool",60,3,60,16,3,16,124,124,343 +"7","R/fisher_information.R","fi_pool",61,3,63,47,3,47,125,127,343 +"8","R/fisher_information.R","fi_pool_cluster",76,3,76,16,3,16,140,140,113 +"9","R/fisher_information.R","fi_pool_cluster",77,3,77,18,3,18,141,141,113 +"10","R/fisher_information.R","fi_pool_cluster",78,3,78,16,3,16,142,142,113 +"11","R/fisher_information.R","fi_pool_cluster",79,3,79,21,3,21,143,143,113 +"12","R/fisher_information.R","fi_pool_cluster",80,3,80,20,3,20,144,144,113 +"13","R/fisher_information.R","fi_pool_cluster",81,3,81,23,3,23,145,145,113 +"14","R/fisher_information.R","fi_pool_cluster",82,3,82,20,3,20,146,146,113 +"15","R/fisher_information.R","fi_pool_cluster",84,7,84,72,7,72,84,84,113 +"16","R/fisher_information.R","fi_pool_cluster",85,5,85,117,5,117,149,149,0 +"17","R/fisher_information.R","fi_pool_cluster",88,7,88,14,7,14,88,88,113 +"18","R/fisher_information.R","fi_pool_cluster",90,5,90,51,5,51,154,154,0 +"19","R/fisher_information.R","fi_pool_cluster",92,7,92,14,7,14,92,92,113 +"20","R/fisher_information.R","fi_pool_cluster",93,5,93,156,5,156,157,157,0 +"21","R/fisher_information.R","fi_pool_cluster",96,7,96,32,7,32,96,96,113 +"22","R/fisher_information.R","fi_pool_cluster",97,5,97,76,5,76,161,161,0 +"23","R/fisher_information.R","fi_pool_cluster",99,3,101,3,3,3,163,165,113 +"24","R/fisher_information.R","fi_pool_cluster",100,5,100,47,5,47,164,164,68718690 +"25","R/fisher_information.R","fi_pool_cluster",103,7,103,37,7,37,103,103,113 +"26","R/fisher_information.R","fi_pool_cluster",107,9,107,26,9,26,107,107,111 +"27","R/fisher_information.R","fi_pool_cluster",108,7,108,27,7,27,172,172,0 +"28","R/fisher_information.R","fi_pool_cluster",109,11,109,24,11,24,109,109,0 +"29","R/fisher_information.R","fi_pool_cluster",109,27,109,89,27,89,109,109,0 +"30","R/fisher_information.R","fi_pool_cluster",118,7,118,14,7,14,182,182,0 +"31","R/fisher_information.R","fi_pool_cluster",119,7,119,24,7,24,183,183,0 +"32","R/fisher_information.R","fi_pool_cluster",121,7,123,54,7,54,185,187,0 +"33","R/fisher_information.R","fi_pool_cluster",124,7,126,40,7,40,188,190,0 +"34","R/fisher_information.R","fi_pool_cluster",127,7,129,48,7,48,191,193,0 +"35","R/fisher_information.R","fi_pool_cluster",130,16,130,29,16,29,130,130,111 +"36","R/fisher_information.R","fi_pool_cluster",131,7,131,24,7,24,195,195,111 +"37","R/fisher_information.R","fi_pool_cluster",132,7,132,27,7,27,196,196,111 +"38","R/fisher_information.R","fi_pool_cluster",133,7,133,32,7,32,197,197,111 +"39","R/fisher_information.R","fi_pool_cluster",134,11,134,70,11,70,134,134,111 +"40","R/fisher_information.R","fi_pool_cluster",135,9,135,16,9,16,199,199,94 +"41","R/fisher_information.R","fi_pool_cluster",136,9,136,29,9,29,200,200,94 +"42","R/fisher_information.R","fi_pool_cluster",137,13,137,18,13,18,137,137,94 +"43","R/fisher_information.R","fi_pool_cluster",139,11,139,89,11,89,203,203,4 +"44","R/fisher_information.R","fi_pool_cluster",141,11,142,50,11,50,205,206,4 +"45","R/fisher_information.R","fi_pool_cluster",144,11,146,62,11,62,208,210,4 +"46","R/fisher_information.R","fi_pool_cluster",148,11,151,12,11,12,212,215,90 +"47","R/fisher_information.R","fi_pool_cluster",149,13,149,20,13,20,213,213,322 +"48","R/fisher_information.R","fi_pool_cluster",150,13,150,111,13,111,214,214,322 +"49","R/fisher_information.R","fi_pool_cluster",153,11,158,12,11,12,217,222,90 +"50","R/fisher_information.R","fi_pool_cluster",154,13,154,20,13,20,218,218,322 +"51","R/fisher_information.R","fi_pool_cluster",155,13,157,66,13,66,219,221,322 +"52","R/fisher_information.R","fi_pool_cluster",160,11,166,12,11,12,224,230,90 +"53","R/fisher_information.R","fi_pool_cluster",161,13,161,20,13,20,225,225,322 +"54","R/fisher_information.R","fi_pool_cluster",162,13,165,83,13,83,226,229,322 +"55","R/fisher_information.R","fi_pool_cluster",170,9,170,31,9,31,234,234,17 +"56","R/fisher_information.R","fi_pool_cluster",173,9,173,59,9,59,237,237,17 +"57","R/fisher_information.R","fi_pool_cluster",190,13,190,34,13,34,190,190,17 +"58","R/fisher_information.R","fi_pool_cluster",191,11,198,11,11,11,255,262,1 +"59","R/fisher_information.R","fi_pool_cluster",192,13,192,47,13,47,256,256,7950 +"60","R/fisher_information.R","fi_pool_cluster",193,17,193,34,17,34,193,193,7950 +"61","R/fisher_information.R","fi_pool_cluster",194,15,194,24,15,24,258,258,16961607 +"62","R/fisher_information.R","fi_pool_cluster",195,15,195,72,15,72,259,259,16961607 +"63","R/fisher_information.R","fi_pool_cluster",197,13,197,15,13,15,261,261,7950 +"64","R/fisher_information.R","fi_pool_cluster",199,11,201,11,11,11,263,265,1 +"65","R/fisher_information.R","fi_pool_cluster",200,13,200,13,13,13,264,264,561 +"66","R/fisher_information.R","fi_pool_cluster",203,11,205,11,11,11,267,269,1 +"67","R/fisher_information.R","fi_pool_cluster",204,13,204,90,13,90,268,268,2686 +"68","R/fisher_information.R","fi_pool_cluster",206,11,208,11,11,11,270,272,1 +"69","R/fisher_information.R","fi_pool_cluster",207,13,207,13,13,13,271,271,561 +"70","R/fisher_information.R","fi_pool_cluster",210,11,212,11,11,11,274,276,1 +"71","R/fisher_information.R","fi_pool_cluster",211,13,211,144,13,144,275,275,2746 +"72","R/fisher_information.R","fi_pool_cluster",213,11,215,11,11,11,277,279,1 +"73","R/fisher_information.R","fi_pool_cluster",214,13,214,13,13,13,278,278,561 +"74","R/fisher_information.R","fi_pool_cluster",216,20,216,40,20,40,216,216,16 +"75","R/fisher_information.R","fi_pool_cluster",217,11,226,11,11,11,281,290,16 +"76","R/fisher_information.R","fi_pool_cluster",218,13,218,47,13,47,282,282,6778 +"77","R/fisher_information.R","fi_pool_cluster",219,13,219,49,13,49,283,283,6778 +"78","R/fisher_information.R","fi_pool_cluster",220,13,220,55,13,55,284,284,6778 +"79","R/fisher_information.R","fi_pool_cluster",221,17,221,34,17,34,221,221,6778 +"80","R/fisher_information.R","fi_pool_cluster",222,15,222,24,15,24,286,286,6039927 +"81","R/fisher_information.R","fi_pool_cluster",223,15,223,101,15,101,287,287,6039927 +"82","R/fisher_information.R","fi_pool_cluster",225,13,225,15,13,15,289,289,6778 +"83","R/fisher_information.R","fi_pool_cluster",227,11,230,11,11,11,291,294,16 +"84","R/fisher_information.R","fi_pool_cluster",228,13,229,86,13,86,292,293,589 +"85","R/fisher_information.R","fi_pool_cluster",232,11,246,11,11,11,296,310,16 +"86","R/fisher_information.R","fi_pool_cluster",233,13,233,54,13,54,297,297,8948 +"87","R/fisher_information.R","fi_pool_cluster",234,13,234,49,13,49,298,298,8948 +"88","R/fisher_information.R","fi_pool_cluster",235,13,235,55,13,55,299,299,8948 +"89","R/fisher_information.R","fi_pool_cluster",236,17,236,34,17,34,236,236,8948 +"90","R/fisher_information.R","fi_pool_cluster",237,15,237,24,15,24,301,301,5566589 +"91","R/fisher_information.R","fi_pool_cluster",238,15,243,116,15,116,302,307,5566589 +"92","R/fisher_information.R","fi_pool_cluster",245,13,245,15,13,15,309,309,8948 +"93","R/fisher_information.R","fi_pool_cluster",247,11,255,11,11,11,311,319,16 +"94","R/fisher_information.R","fi_pool_cluster",248,13,254,60,13,60,312,318,539 +"95","R/fisher_information.R","fi_pool_cluster",257,11,271,11,11,11,321,335,16 +"96","R/fisher_information.R","fi_pool_cluster",258,13,258,58,13,58,322,322,8830 +"97","R/fisher_information.R","fi_pool_cluster",259,13,259,49,13,49,323,323,8830 +"98","R/fisher_information.R","fi_pool_cluster",260,13,260,55,13,55,324,324,8830 +"99","R/fisher_information.R","fi_pool_cluster",261,17,261,34,17,34,261,261,8830 +"100","R/fisher_information.R","fi_pool_cluster",262,15,262,24,15,24,326,326,5554132 +"101","R/fisher_information.R","fi_pool_cluster",263,15,268,166,15,166,327,332,5554132 +"102","R/fisher_information.R","fi_pool_cluster",270,13,270,15,13,15,334,334,8830 +"103","R/fisher_information.R","fi_pool_cluster",272,11,280,11,11,11,336,344,16 +"104","R/fisher_information.R","fi_pool_cluster",273,13,279,163,13,163,337,343,537 +"105","R/fisher_information.R","fi_pool_cluster",283,9,283,38,9,38,347,347,17 +"106","R/fisher_information.R","fi_pool_cluster",284,9,290,10,9,10,348,354,17 +"107","R/fisher_information.R","fi_pool_cluster",285,11,287,63,11,63,349,351,1152 +"108","R/fisher_information.R","fi_pool_cluster",286,13,286,27,13,27,350,350,1152 +"109","R/fisher_information.R","fi_pool_cluster",288,11,289,30,11,30,352,353,1152 +"110","R/fisher_information.R","fi_pool_cluster",292,9,298,10,9,10,356,362,15 +"111","R/fisher_information.R","fi_pool_cluster",293,11,295,69,11,69,357,359,1100 +"112","R/fisher_information.R","fi_pool_cluster",294,13,294,33,13,33,358,358,1100 +"113","R/fisher_information.R","fi_pool_cluster",296,11,297,30,11,30,360,361,1100 +"114","R/fisher_information.R","fi_pool_cluster",300,9,306,10,9,10,364,370,15 +"115","R/fisher_information.R","fi_pool_cluster",301,11,303,80,11,80,365,367,1099 +"116","R/fisher_information.R","fi_pool_cluster",302,13,302,31,13,31,366,366,1099 +"117","R/fisher_information.R","fi_pool_cluster",304,11,305,30,11,30,368,369,1099 +"118","R/fisher_information.R","fi_pool_cluster",309,5,309,15,5,15,373,373,108 +"119","R/fisher_information.R","fi_pool_cluster",310,9,312,29,9,29,310,312,108 +"120","R/fisher_information.R","fi_pool_cluster",313,7,313,16,7,16,377,377,1 +"121","R/fisher_information.R","fi_pool_cluster",314,7,314,25,7,25,378,378,1 +"122","R/fisher_information.R","fi_pool_cluster",315,7,315,22,7,22,379,379,1 +"123","R/fisher_information.R","fi_pool_cluster",316,7,316,27,7,27,380,380,1 +"124","R/fisher_information.R","fi_pool_cluster",317,7,317,20,7,20,381,381,1 +"125","R/fisher_information.R","fi_pool_cluster",318,7,318,25,7,25,382,382,1 +"126","R/fisher_information.R","fi_pool_cluster",319,7,319,14,7,14,383,383,1 +"127","R/fisher_information.R","fi_pool_cluster",320,7,320,14,7,14,384,384,1 +"128","R/fisher_information.R","fi_pool_cluster",321,7,321,18,7,18,385,385,1 +"129","R/fisher_information.R","fi_pool_cluster",322,7,322,19,7,19,386,386,1 +"130","R/fisher_information.R","fi_pool_cluster",323,7,323,16,7,16,387,387,1 +"131","R/fisher_information.R","fi_pool_cluster",324,7,324,24,7,24,388,388,1 +"132","R/fisher_information.R","fi_pool_cluster",325,7,325,17,7,17,389,389,1 +"133","R/fisher_information.R","fi_pool_cluster",326,7,326,151,7,151,390,390,1 +"134","R/fisher_information.R","fi_pool_cluster",329,5,336,6,5,6,393,400,107 +"135","R/fisher_information.R","fi_pool_cluster",337,14,337,52,14,52,337,337,2 +"136","R/fisher_information.R","fi_pool_cluster",338,5,341,5,5,5,402,405,2 +"137","R/fisher_information.R","fi_pool_cluster",342,5,345,5,5,5,406,409,2 +"138","R/fisher_information.R","fi_pool_cluster",348,5,348,78,5,78,412,412,2 +"139","R/fisher_information.R","fi_pool_cluster",349,5,349,17,5,17,413,413,2 +"140","R/fisher_information.R","fi_pool_cluster",350,5,350,20,5,20,414,414,2 +"141","R/fisher_information.R","fi_pool_cluster",353,5,353,55,5,55,417,417,2 +"142","R/fisher_information.R","fi_pool_cluster",356,5,364,5,5,5,420,428,2 +"143","R/fisher_information.R","fi_pool_cluster",357,7,357,51,7,51,421,421,15806 +"144","R/fisher_information.R","fi_pool_cluster",358,7,358,21,7,21,422,422,15806 +"145","R/fisher_information.R","fi_pool_cluster",359,11,359,28,11,28,359,359,15806 +"146","R/fisher_information.R","fi_pool_cluster",360,9,360,18,9,18,424,424,237090 +"147","R/fisher_information.R","fi_pool_cluster",361,9,361,66,9,66,425,425,237090 +"148","R/fisher_information.R","fi_pool_cluster",363,7,363,9,7,9,427,427,15806 +"149","R/fisher_information.R","fi_pool_cluster",366,5,368,5,5,5,430,432,2 +"150","R/fisher_information.R","fi_pool_cluster",367,7,367,40,7,40,431,431,5466 +"151","R/fisher_information.R","fi_pool_cluster",370,5,372,5,5,5,434,436,2 +"152","R/fisher_information.R","fi_pool_cluster",371,7,371,56,7,56,435,435,5030 +"153","R/fisher_information.R","fi_pool_cluster",374,5,374,34,5,34,438,438,2 +"154","R/fisher_information.R","fi_pool_cluster",375,5,379,6,5,6,439,443,2 +"155","R/fisher_information.R","fi_pool_cluster",377,7,378,26,7,26,441,442,187 +"156","R/fisher_information.R","fi_pool_cluster",381,5,385,6,5,6,445,449,2 +"157","R/fisher_information.R","fi_pool_cluster",383,7,384,26,7,26,447,448,187 +"158","R/fisher_information.R","fi_pool_cluster",387,5,391,6,5,6,451,455,2 +"159","R/fisher_information.R","fi_pool_cluster",389,7,390,26,7,26,453,454,187 +"160","R/fisher_information.R","fi_pool_cluster",394,5,394,15,5,15,458,458,2 +"161","R/fisher_information.R","fi_pool_cluster",395,9,397,31,9,31,395,397,2 +"162","R/fisher_information.R","fi_pool_cluster",398,7,398,16,7,16,462,462,0 +"163","R/fisher_information.R","fi_pool_cluster",399,7,399,25,7,25,463,463,0 +"164","R/fisher_information.R","fi_pool_cluster",400,7,400,19,7,19,464,464,0 +"165","R/fisher_information.R","fi_pool_cluster",401,7,401,24,7,24,465,465,0 +"166","R/fisher_information.R","fi_pool_cluster",402,7,402,22,7,22,466,466,0 +"167","R/fisher_information.R","fi_pool_cluster",403,7,403,27,7,27,467,467,0 +"168","R/fisher_information.R","fi_pool_cluster",404,7,404,14,7,14,468,468,0 +"169","R/fisher_information.R","fi_pool_cluster",405,7,405,14,7,14,469,469,0 +"170","R/fisher_information.R","fi_pool_cluster",406,7,406,18,7,18,470,470,0 +"171","R/fisher_information.R","fi_pool_cluster",407,7,407,19,7,19,471,471,0 +"172","R/fisher_information.R","fi_pool_cluster",408,7,408,16,7,16,472,472,0 +"173","R/fisher_information.R","fi_pool_cluster",409,7,409,24,7,24,473,473,0 +"174","R/fisher_information.R","fi_pool_cluster",410,7,410,17,7,17,474,474,0 +"175","R/fisher_information.R","fi_pool_cluster",411,7,411,150,7,150,475,475,0 +"176","R/fisher_information.R","fi_pool_cluster",414,5,421,5,5,5,478,485,2 +"177","R/fisher_information.R","fi_pool_cluster",422,9,422,18,9,18,422,422,2 +"178","R/fisher_information.R","fi_pool_cluster",423,7,423,16,7,16,487,487,0 +"179","R/fisher_information.R","fi_pool_cluster",425,7,427,7,7,7,489,491,2 +"180","R/fisher_information.R","fi_pool_cluster",426,9,426,78,9,78,490,490,48 +"181","R/fisher_information.R","fi_pool_cluster",429,7,431,7,7,7,493,495,2 +"182","R/fisher_information.R","fi_pool_cluster",430,9,430,94,9,94,494,494,48 +"183","R/fisher_information.R","fi_pool_cluster",434,7,436,7,7,7,498,500,2 +"184","R/fisher_information.R","fi_pool_cluster",435,9,435,80,9,80,499,499,48 +"185","R/fisher_information.R","fi_pool_cluster",438,7,440,7,7,7,502,504,2 +"186","R/fisher_information.R","fi_pool_cluster",439,9,439,96,9,96,503,503,48 +"187","R/fisher_information.R","fi_pool_cluster",442,7,442,36,7,36,506,506,2 +"188","R/fisher_information.R","fi_pool_cluster",443,7,443,106,7,106,507,507,2 +"189","R/fisher_information.R","fi_pool_cluster",444,7,444,112,7,112,508,508,2 +"190","R/fisher_information.R","fi_pool_cluster",445,7,445,102,7,102,509,509,2 +"191","R/fisher_information.R","fi_pool_cluster",446,7,446,103,7,103,510,510,2 +"192","R/fisher_information.R","fi_pool_cluster",447,7,447,108,7,108,511,511,2 +"193","R/fisher_information.R","fi_pool_cluster",448,7,448,112,7,112,512,512,2 +"194","R/fisher_information.R","fi_pool_cluster",451,7,457,8,7,8,515,521,2 +"195","R/fisher_information.R","fi_pool_cluster",459,7,459,31,7,31,523,523,2 +"196","R/fisher_information.R","fi_pool_cluster",462,5,462,126,5,126,526,526,0 +"197","R/optimise_prevalence.R","optimise_s_prevalence",74,3,74,18,3,18,603,603,16 +"198","R/optimise_prevalence.R","optimise_s_prevalence",76,7,76,24,7,24,76,76,16 +"199","R/optimise_prevalence.R","optimise_s_prevalence",77,5,79,67,5,67,606,608,1 +"200","R/optimise_prevalence.R","optimise_s_prevalence",81,7,81,18,7,18,81,81,15 +"201","R/optimise_prevalence.R","optimise_s_prevalence",81,21,81,56,21,56,81,81,1 +"202","R/optimise_prevalence.R","optimise_s_prevalence",83,3,83,23,3,23,612,612,14 +"203","R/optimise_prevalence.R","optimise_s_prevalence",93,7,93,22,7,22,93,93,14 +"204","R/optimise_prevalence.R","optimise_s_prevalence",94,5,94,18,5,18,623,623,2 +"205","R/optimise_prevalence.R","optimise_s_prevalence",95,5,95,18,5,18,624,624,2 +"206","R/optimise_prevalence.R","optimise_s_prevalence",96,5,96,24,5,24,625,625,2 +"207","R/optimise_prevalence.R","optimise_s_prevalence",106,7,106,22,7,22,106,106,14 +"208","R/optimise_prevalence.R","optimise_s_prevalence",107,5,107,18,5,18,636,636,1 +"209","R/optimise_prevalence.R","optimise_s_prevalence",108,5,108,18,5,18,637,637,1 +"210","R/optimise_prevalence.R","optimise_s_prevalence",109,5,109,24,5,24,638,638,1 +"211","R/optimise_prevalence.R","optimise_s_prevalence",111,7,111,24,7,24,111,111,14 +"212","R/optimise_prevalence.R","optimise_s_prevalence",112,5,115,5,5,5,641,644,9 +"213","R/optimise_prevalence.R","optimise_s_prevalence",113,7,113,83,7,83,642,642,336 +"214","R/optimise_prevalence.R","optimise_s_prevalence",114,7,114,9,7,9,643,643,336 +"215","R/optimise_prevalence.R","optimise_s_prevalence",117,5,127,5,5,5,646,656,5 +"216","R/optimise_prevalence.R","optimise_s_prevalence",118,7,125,7,7,7,647,654,103 +"217","R/optimise_prevalence.R","optimise_s_prevalence",126,7,126,9,7,9,655,655,102 +"218","R/optimise_prevalence.R","optimise_s_prevalence",130,3,130,43,3,43,659,659,14 +"219","R/optimise_prevalence.R","optimise_s_prevalence",131,3,131,48,3,48,660,660,13 +"220","R/optimise_prevalence.R","optimise_s_prevalence",132,3,132,44,3,44,661,661,13 +"221","R/optimise_prevalence.R","optimise_s_prevalence",134,7,134,39,7,39,134,134,13 +"222","R/optimise_prevalence.R","optimise_s_prevalence",135,5,135,29,5,29,664,664,5 +"223","R/optimise_prevalence.R","optimise_s_prevalence",136,5,136,32,5,32,665,665,5 +"224","R/optimise_prevalence.R","optimise_s_prevalence",138,5,138,27,5,27,667,667,8 +"225","R/optimise_prevalence.R","optimise_s_prevalence",139,5,139,30,5,30,668,668,8 +"226","R/optimise_prevalence.R","optimise_s_prevalence",142,7,142,16,7,16,142,142,13 +"227","R/optimise_prevalence.R","optimise_s_prevalence",142,19,142,139,19,139,142,142,1 +"228","R/optimise_prevalence.R","optimise_s_prevalence",144,7,144,19,7,19,144,144,13 +"229","R/optimise_prevalence.R","optimise_s_prevalence",145,9,145,20,9,20,145,145,8 +"230","R/optimise_prevalence.R","optimise_s_prevalence",145,23,145,36,23,36,145,145,1 +"231","R/optimise_prevalence.R","optimise_s_prevalence",146,5,146,55,5,55,675,675,8 +"232","R/optimise_prevalence.R","optimise_s_prevalence",147,14,147,25,14,25,147,147,5 +"233","R/optimise_prevalence.R","optimise_s_prevalence",148,5,148,41,5,41,677,677,5 +"234","R/optimise_prevalence.R","optimise_s_prevalence",149,9,149,26,9,26,149,149,5 +"235","R/optimise_prevalence.R","optimise_s_prevalence",150,7,150,16,7,16,679,679,2 +"236","R/optimise_prevalence.R","optimise_s_prevalence",152,7,154,23,7,23,681,683,3 +"237","R/optimise_prevalence.R","optimise_s_prevalence",153,9,153,26,9,26,682,682,26 +"238","R/optimise_prevalence.R","optimise_s_prevalence",156,9,156,30,9,30,156,156,5 +"239","R/optimise_prevalence.R","optimise_s_prevalence",157,7,157,20,7,20,686,686,1 +"240","R/optimise_prevalence.R","optimise_s_prevalence",158,7,158,132,7,132,687,687,1 +"241","R/optimise_prevalence.R","optimise_s_prevalence",160,7,162,27,7,27,689,691,4 +"242","R/optimise_prevalence.R","optimise_s_prevalence",161,9,161,26,9,26,690,690,52 +"243","R/optimise_prevalence.R","optimise_s_prevalence",164,9,164,20,9,20,164,164,5 +"244","R/optimise_prevalence.R","optimise_s_prevalence",165,7,165,20,7,20,694,694,2 +"245","R/optimise_prevalence.R","optimise_s_prevalence",166,7,166,25,7,25,695,695,2 +"246","R/optimise_prevalence.R","optimise_s_prevalence",168,7,168,50,7,50,697,697,3 +"247","R/optimise_prevalence.R","optimise_s_prevalence",170,5,177,5,5,5,699,706,5 +"248","R/optimise_prevalence.R","optimise_s_prevalence",179,3,179,5,3,5,708,708,5 +"249","R/optimise_prevalence.R","optimise_sN_prevalence",196,7,196,44,7,44,196,196,3 +"250","R/optimise_prevalence.R","optimise_sN_prevalence",197,5,200,5,5,5,726,729,1 +"251","R/optimise_prevalence.R","optimise_sN_prevalence",202,5,202,48,5,48,731,731,1 +"252","R/optimise_prevalence.R","optimise_sN_prevalence",203,5,203,22,5,22,732,732,1 +"253","R/optimise_prevalence.R","optimise_sN_prevalence",205,5,205,13,5,13,734,734,2 +"254","R/optimise_prevalence.R","optimise_sN_prevalence",206,5,206,27,5,27,735,735,2 +"255","R/optimise_prevalence.R","optimise_sN_prevalence",207,5,219,5,5,5,736,748,2 +"256","R/optimise_prevalence.R","optimise_sN_prevalence",208,7,211,7,7,7,737,740,4 +"257","R/optimise_prevalence.R","optimise_sN_prevalence",213,11,213,33,11,33,213,213,4 +"258","R/optimise_prevalence.R","optimise_sN_prevalence",214,9,214,13,9,13,743,743,2 +"259","R/optimise_prevalence.R","optimise_sN_prevalence",216,9,216,24,9,24,745,745,2 +"260","R/optimise_prevalence.R","optimise_sN_prevalence",217,9,217,22,9,22,746,746,2 +"261","R/optimise_prevalence.R","optimise_sN_prevalence",220,5,220,17,5,17,749,749,2 +"262","R/optimise_prevalence.R","optimise_sN_prevalence",221,9,221,22,9,22,221,221,2 +"263","R/optimise_prevalence.R","optimise_sN_prevalence",222,7,222,129,7,129,751,751,0 +"264","R/optimise_prevalence.R","optimise_sN_prevalence",224,9,224,22,9,22,224,224,2 +"265","R/optimise_prevalence.R","optimise_sN_prevalence",225,7,225,127,7,127,754,754,0 +"266","R/optimise_prevalence.R","optimise_sN_prevalence",229,3,229,5,3,5,758,758,3 +"267","R/optimise_prevalence.R","cost_fi",233,3,234,60,3,60,762,763,336 +"268","R/optimise_prevalence.R","cost_fi_cluster",247,3,247,16,3,16,776,776,103 +"269","R/optimise_prevalence.R","cost_fi_cluster",248,3,248,18,3,18,777,777,103 +"270","R/optimise_prevalence.R","cost_fi_cluster",250,3,250,86,3,86,779,779,103 +"271","R/optimise_prevalence.R","cost_fi_cluster",251,3,251,68,3,68,780,780,102 +"272","R/optimise_prevalence.R","cost_fi_cluster",253,3,253,24,3,24,782,782,102 +"273","R/util.R","cloglog",5,3,5,18,3,18,789,789,2 +"274","R/util.R","cloglog_inv",8,3,8,18,3,18,792,792,29878 +"275","R/util.R","mu_sigma_linknorm",14,6,14,31,6,31,798,798,2 +"276","R/util.R","mu_sigma_linknorm",15,5,15,69,5,69,799,799,0 +"277","R/util.R","mu_sigma_linknorm",17,3,17,26,3,26,801,801,2 +"278","R/util.R","mu_sigma_linknorm",18,3,18,14,3,14,802,802,2 +"279","R/util.R","mu_sigma_linknorm",19,3,27,3,3,3,803,811,2 +"280","R/util.R","mu_sigma_linknorm",20,5,20,14,5,14,804,804,338 +"281","R/util.R","mu_sigma_linknorm",21,5,21,22,5,22,805,805,338 +"282","R/util.R","mu_sigma_linknorm",22,5,22,75,5,75,806,806,338 +"283","R/util.R","mu_sigma_linknorm",23,5,23,71,5,71,807,807,338 +"284","R/util.R","mu_sigma_linknorm",24,5,24,86,5,86,808,808,338 +"285","R/util.R","mu_sigma_linknorm",25,5,25,71,5,71,809,809,338 +"286","R/util.R","mu_sigma_linknorm",26,5,26,46,5,46,810,810,338 +"287","R/util.R","mu_sigma_linknorm",28,3,28,84,3,84,812,812,2 +"288","R/util.R","mu_sigma_linknorm",29,3,29,23,3,23,813,813,2 +"289","R/util.R","mu_sigma_linknorm",30,3,30,5,3,5,814,814,2 diff --git a/dev_resources/coverage.csv b/dev_resources/coverage.csv new file mode 100644 index 0000000..485cf45 --- /dev/null +++ b/dev_resources/coverage.csv @@ -0,0 +1,290 @@ +"","filename","functions","first_line","first_byte","last_line","last_byte","first_column","last_column","first_parsed","last_parsed","value" +"1","R/design_effect.R","design_effect",56,3,60,11,3,11,58,62,4 +"2","R/fisher_information.R","fi_pool",55,3,55,16,3,16,119,119,343 +"3","R/fisher_information.R","fi_pool",56,3,56,21,3,21,120,120,343 +"4","R/fisher_information.R","fi_pool",57,3,57,23,3,23,121,121,343 +"5","R/fisher_information.R","fi_pool",58,3,58,20,3,20,122,122,343 +"6","R/fisher_information.R","fi_pool",60,3,60,16,3,16,124,124,343 +"7","R/fisher_information.R","fi_pool",61,3,63,47,3,47,125,127,343 +"8","R/fisher_information.R","fi_pool_cluster",76,3,76,16,3,16,140,140,113 +"9","R/fisher_information.R","fi_pool_cluster",77,3,77,18,3,18,141,141,113 +"10","R/fisher_information.R","fi_pool_cluster",78,3,78,16,3,16,142,142,113 +"11","R/fisher_information.R","fi_pool_cluster",79,3,79,21,3,21,143,143,113 +"12","R/fisher_information.R","fi_pool_cluster",80,3,80,20,3,20,144,144,113 +"13","R/fisher_information.R","fi_pool_cluster",81,3,81,23,3,23,145,145,113 +"14","R/fisher_information.R","fi_pool_cluster",82,3,82,20,3,20,146,146,113 +"15","R/fisher_information.R","fi_pool_cluster",84,7,84,72,7,72,84,84,113 +"16","R/fisher_information.R","fi_pool_cluster",85,5,85,117,5,117,149,149,0 +"17","R/fisher_information.R","fi_pool_cluster",88,7,88,14,7,14,88,88,113 +"18","R/fisher_information.R","fi_pool_cluster",90,5,90,51,5,51,154,154,0 +"19","R/fisher_information.R","fi_pool_cluster",92,7,92,14,7,14,92,92,113 +"20","R/fisher_information.R","fi_pool_cluster",93,5,93,156,5,156,157,157,0 +"21","R/fisher_information.R","fi_pool_cluster",96,7,96,32,7,32,96,96,113 +"22","R/fisher_information.R","fi_pool_cluster",97,5,97,76,5,76,161,161,0 +"23","R/fisher_information.R","fi_pool_cluster",99,3,101,3,3,3,163,165,113 +"24","R/fisher_information.R","fi_pool_cluster",100,5,100,47,5,47,164,164,68718690 +"25","R/fisher_information.R","fi_pool_cluster",103,7,103,37,7,37,103,103,113 +"26","R/fisher_information.R","fi_pool_cluster",107,9,107,26,9,26,107,107,111 +"27","R/fisher_information.R","fi_pool_cluster",108,7,108,27,7,27,172,172,0 +"28","R/fisher_information.R","fi_pool_cluster",109,11,109,24,11,24,109,109,0 +"29","R/fisher_information.R","fi_pool_cluster",109,27,109,89,27,89,109,109,0 +"30","R/fisher_information.R","fi_pool_cluster",118,7,118,14,7,14,182,182,0 +"31","R/fisher_information.R","fi_pool_cluster",119,7,119,24,7,24,183,183,0 +"32","R/fisher_information.R","fi_pool_cluster",121,7,123,54,7,54,185,187,0 +"33","R/fisher_information.R","fi_pool_cluster",124,7,126,40,7,40,188,190,0 +"34","R/fisher_information.R","fi_pool_cluster",127,7,129,48,7,48,191,193,0 +"35","R/fisher_information.R","fi_pool_cluster",130,16,130,29,16,29,130,130,111 +"36","R/fisher_information.R","fi_pool_cluster",131,7,131,24,7,24,195,195,111 +"37","R/fisher_information.R","fi_pool_cluster",132,7,132,27,7,27,196,196,111 +"38","R/fisher_information.R","fi_pool_cluster",133,7,133,32,7,32,197,197,111 +"39","R/fisher_information.R","fi_pool_cluster",134,11,134,70,11,70,134,134,111 +"40","R/fisher_information.R","fi_pool_cluster",135,9,135,16,9,16,199,199,94 +"41","R/fisher_information.R","fi_pool_cluster",136,9,136,29,9,29,200,200,94 +"42","R/fisher_information.R","fi_pool_cluster",137,13,137,18,13,18,137,137,94 +"43","R/fisher_information.R","fi_pool_cluster",139,11,139,89,11,89,203,203,4 +"44","R/fisher_information.R","fi_pool_cluster",141,11,142,50,11,50,205,206,4 +"45","R/fisher_information.R","fi_pool_cluster",144,11,146,62,11,62,208,210,4 +"46","R/fisher_information.R","fi_pool_cluster",148,11,151,12,11,12,212,215,90 +"47","R/fisher_information.R","fi_pool_cluster",149,13,149,20,13,20,213,213,322 +"48","R/fisher_information.R","fi_pool_cluster",150,13,150,111,13,111,214,214,322 +"49","R/fisher_information.R","fi_pool_cluster",153,11,158,12,11,12,217,222,90 +"50","R/fisher_information.R","fi_pool_cluster",154,13,154,20,13,20,218,218,322 +"51","R/fisher_information.R","fi_pool_cluster",155,13,157,66,13,66,219,221,322 +"52","R/fisher_information.R","fi_pool_cluster",160,11,166,12,11,12,224,230,90 +"53","R/fisher_information.R","fi_pool_cluster",161,13,161,20,13,20,225,225,322 +"54","R/fisher_information.R","fi_pool_cluster",162,13,165,83,13,83,226,229,322 +"55","R/fisher_information.R","fi_pool_cluster",170,9,170,31,9,31,234,234,17 +"56","R/fisher_information.R","fi_pool_cluster",173,9,173,59,9,59,237,237,17 +"57","R/fisher_information.R","fi_pool_cluster",190,13,190,34,13,34,190,190,17 +"58","R/fisher_information.R","fi_pool_cluster",191,11,198,11,11,11,255,262,1 +"59","R/fisher_information.R","fi_pool_cluster",192,13,192,47,13,47,256,256,7950 +"60","R/fisher_information.R","fi_pool_cluster",193,17,193,34,17,34,193,193,7950 +"61","R/fisher_information.R","fi_pool_cluster",194,15,194,24,15,24,258,258,16961607 +"62","R/fisher_information.R","fi_pool_cluster",195,15,195,72,15,72,259,259,16961607 +"63","R/fisher_information.R","fi_pool_cluster",197,13,197,15,13,15,261,261,7950 +"64","R/fisher_information.R","fi_pool_cluster",199,11,201,11,11,11,263,265,1 +"65","R/fisher_information.R","fi_pool_cluster",200,13,200,13,13,13,264,264,561 +"66","R/fisher_information.R","fi_pool_cluster",203,11,205,11,11,11,267,269,1 +"67","R/fisher_information.R","fi_pool_cluster",204,13,204,90,13,90,268,268,2686 +"68","R/fisher_information.R","fi_pool_cluster",206,11,208,11,11,11,270,272,1 +"69","R/fisher_information.R","fi_pool_cluster",207,13,207,13,13,13,271,271,561 +"70","R/fisher_information.R","fi_pool_cluster",210,11,212,11,11,11,274,276,1 +"71","R/fisher_information.R","fi_pool_cluster",211,13,211,144,13,144,275,275,2746 +"72","R/fisher_information.R","fi_pool_cluster",213,11,215,11,11,11,277,279,1 +"73","R/fisher_information.R","fi_pool_cluster",214,13,214,13,13,13,278,278,561 +"74","R/fisher_information.R","fi_pool_cluster",216,20,216,40,20,40,216,216,16 +"75","R/fisher_information.R","fi_pool_cluster",217,11,226,11,11,11,281,290,16 +"76","R/fisher_information.R","fi_pool_cluster",218,13,218,47,13,47,282,282,6778 +"77","R/fisher_information.R","fi_pool_cluster",219,13,219,49,13,49,283,283,6778 +"78","R/fisher_information.R","fi_pool_cluster",220,13,220,55,13,55,284,284,6778 +"79","R/fisher_information.R","fi_pool_cluster",221,17,221,34,17,34,221,221,6778 +"80","R/fisher_information.R","fi_pool_cluster",222,15,222,24,15,24,286,286,6039927 +"81","R/fisher_information.R","fi_pool_cluster",223,15,223,101,15,101,287,287,6039927 +"82","R/fisher_information.R","fi_pool_cluster",225,13,225,15,13,15,289,289,6778 +"83","R/fisher_information.R","fi_pool_cluster",227,11,230,11,11,11,291,294,16 +"84","R/fisher_information.R","fi_pool_cluster",228,13,229,86,13,86,292,293,589 +"85","R/fisher_information.R","fi_pool_cluster",232,11,246,11,11,11,296,310,16 +"86","R/fisher_information.R","fi_pool_cluster",233,13,233,54,13,54,297,297,8948 +"87","R/fisher_information.R","fi_pool_cluster",234,13,234,49,13,49,298,298,8948 +"88","R/fisher_information.R","fi_pool_cluster",235,13,235,55,13,55,299,299,8948 +"89","R/fisher_information.R","fi_pool_cluster",236,17,236,34,17,34,236,236,8948 +"90","R/fisher_information.R","fi_pool_cluster",237,15,237,24,15,24,301,301,5566589 +"91","R/fisher_information.R","fi_pool_cluster",238,15,243,116,15,116,302,307,5566589 +"92","R/fisher_information.R","fi_pool_cluster",245,13,245,15,13,15,309,309,8948 +"93","R/fisher_information.R","fi_pool_cluster",247,11,255,11,11,11,311,319,16 +"94","R/fisher_information.R","fi_pool_cluster",248,13,254,60,13,60,312,318,539 +"95","R/fisher_information.R","fi_pool_cluster",257,11,271,11,11,11,321,335,16 +"96","R/fisher_information.R","fi_pool_cluster",258,13,258,58,13,58,322,322,8830 +"97","R/fisher_information.R","fi_pool_cluster",259,13,259,49,13,49,323,323,8830 +"98","R/fisher_information.R","fi_pool_cluster",260,13,260,55,13,55,324,324,8830 +"99","R/fisher_information.R","fi_pool_cluster",261,17,261,34,17,34,261,261,8830 +"100","R/fisher_information.R","fi_pool_cluster",262,15,262,24,15,24,326,326,5554132 +"101","R/fisher_information.R","fi_pool_cluster",263,15,268,166,15,166,327,332,5554132 +"102","R/fisher_information.R","fi_pool_cluster",270,13,270,15,13,15,334,334,8830 +"103","R/fisher_information.R","fi_pool_cluster",272,11,280,11,11,11,336,344,16 +"104","R/fisher_information.R","fi_pool_cluster",273,13,279,163,13,163,337,343,537 +"105","R/fisher_information.R","fi_pool_cluster",283,9,283,38,9,38,347,347,17 +"106","R/fisher_information.R","fi_pool_cluster",284,9,290,10,9,10,348,354,17 +"107","R/fisher_information.R","fi_pool_cluster",285,11,287,63,11,63,349,351,1152 +"108","R/fisher_information.R","fi_pool_cluster",286,13,286,27,13,27,350,350,1152 +"109","R/fisher_information.R","fi_pool_cluster",288,11,289,30,11,30,352,353,1152 +"110","R/fisher_information.R","fi_pool_cluster",292,9,298,10,9,10,356,362,15 +"111","R/fisher_information.R","fi_pool_cluster",293,11,295,69,11,69,357,359,1100 +"112","R/fisher_information.R","fi_pool_cluster",294,13,294,33,13,33,358,358,1100 +"113","R/fisher_information.R","fi_pool_cluster",296,11,297,30,11,30,360,361,1100 +"114","R/fisher_information.R","fi_pool_cluster",300,9,306,10,9,10,364,370,15 +"115","R/fisher_information.R","fi_pool_cluster",301,11,303,80,11,80,365,367,1099 +"116","R/fisher_information.R","fi_pool_cluster",302,13,302,31,13,31,366,366,1099 +"117","R/fisher_information.R","fi_pool_cluster",304,11,305,30,11,30,368,369,1099 +"118","R/fisher_information.R","fi_pool_cluster",309,5,309,15,5,15,373,373,108 +"119","R/fisher_information.R","fi_pool_cluster",310,9,312,29,9,29,310,312,108 +"120","R/fisher_information.R","fi_pool_cluster",313,7,313,16,7,16,377,377,1 +"121","R/fisher_information.R","fi_pool_cluster",314,7,314,25,7,25,378,378,1 +"122","R/fisher_information.R","fi_pool_cluster",315,7,315,22,7,22,379,379,1 +"123","R/fisher_information.R","fi_pool_cluster",316,7,316,27,7,27,380,380,1 +"124","R/fisher_information.R","fi_pool_cluster",317,7,317,20,7,20,381,381,1 +"125","R/fisher_information.R","fi_pool_cluster",318,7,318,25,7,25,382,382,1 +"126","R/fisher_information.R","fi_pool_cluster",319,7,319,14,7,14,383,383,1 +"127","R/fisher_information.R","fi_pool_cluster",320,7,320,14,7,14,384,384,1 +"128","R/fisher_information.R","fi_pool_cluster",321,7,321,18,7,18,385,385,1 +"129","R/fisher_information.R","fi_pool_cluster",322,7,322,19,7,19,386,386,1 +"130","R/fisher_information.R","fi_pool_cluster",323,7,323,16,7,16,387,387,1 +"131","R/fisher_information.R","fi_pool_cluster",324,7,324,24,7,24,388,388,1 +"132","R/fisher_information.R","fi_pool_cluster",325,7,325,17,7,17,389,389,1 +"133","R/fisher_information.R","fi_pool_cluster",326,7,326,151,7,151,390,390,1 +"134","R/fisher_information.R","fi_pool_cluster",329,5,336,6,5,6,393,400,107 +"135","R/fisher_information.R","fi_pool_cluster",337,14,337,52,14,52,337,337,2 +"136","R/fisher_information.R","fi_pool_cluster",338,5,341,5,5,5,402,405,2 +"137","R/fisher_information.R","fi_pool_cluster",342,5,345,5,5,5,406,409,2 +"138","R/fisher_information.R","fi_pool_cluster",348,5,348,78,5,78,412,412,2 +"139","R/fisher_information.R","fi_pool_cluster",349,5,349,17,5,17,413,413,2 +"140","R/fisher_information.R","fi_pool_cluster",350,5,350,20,5,20,414,414,2 +"141","R/fisher_information.R","fi_pool_cluster",353,5,353,55,5,55,417,417,2 +"142","R/fisher_information.R","fi_pool_cluster",356,5,364,5,5,5,420,428,2 +"143","R/fisher_information.R","fi_pool_cluster",357,7,357,51,7,51,421,421,15806 +"144","R/fisher_information.R","fi_pool_cluster",358,7,358,21,7,21,422,422,15806 +"145","R/fisher_information.R","fi_pool_cluster",359,11,359,28,11,28,359,359,15806 +"146","R/fisher_information.R","fi_pool_cluster",360,9,360,18,9,18,424,424,237090 +"147","R/fisher_information.R","fi_pool_cluster",361,9,361,66,9,66,425,425,237090 +"148","R/fisher_information.R","fi_pool_cluster",363,7,363,9,7,9,427,427,15806 +"149","R/fisher_information.R","fi_pool_cluster",366,5,368,5,5,5,430,432,2 +"150","R/fisher_information.R","fi_pool_cluster",367,7,367,40,7,40,431,431,5466 +"151","R/fisher_information.R","fi_pool_cluster",370,5,372,5,5,5,434,436,2 +"152","R/fisher_information.R","fi_pool_cluster",371,7,371,56,7,56,435,435,5030 +"153","R/fisher_information.R","fi_pool_cluster",374,5,374,34,5,34,438,438,2 +"154","R/fisher_information.R","fi_pool_cluster",375,5,379,6,5,6,439,443,2 +"155","R/fisher_information.R","fi_pool_cluster",377,7,378,26,7,26,441,442,187 +"156","R/fisher_information.R","fi_pool_cluster",381,5,385,6,5,6,445,449,2 +"157","R/fisher_information.R","fi_pool_cluster",383,7,384,26,7,26,447,448,187 +"158","R/fisher_information.R","fi_pool_cluster",387,5,391,6,5,6,451,455,2 +"159","R/fisher_information.R","fi_pool_cluster",389,7,390,26,7,26,453,454,187 +"160","R/fisher_information.R","fi_pool_cluster",394,5,394,15,5,15,458,458,2 +"161","R/fisher_information.R","fi_pool_cluster",395,9,397,31,9,31,395,397,2 +"162","R/fisher_information.R","fi_pool_cluster",398,7,398,16,7,16,462,462,0 +"163","R/fisher_information.R","fi_pool_cluster",399,7,399,25,7,25,463,463,0 +"164","R/fisher_information.R","fi_pool_cluster",400,7,400,19,7,19,464,464,0 +"165","R/fisher_information.R","fi_pool_cluster",401,7,401,24,7,24,465,465,0 +"166","R/fisher_information.R","fi_pool_cluster",402,7,402,22,7,22,466,466,0 +"167","R/fisher_information.R","fi_pool_cluster",403,7,403,27,7,27,467,467,0 +"168","R/fisher_information.R","fi_pool_cluster",404,7,404,14,7,14,468,468,0 +"169","R/fisher_information.R","fi_pool_cluster",405,7,405,14,7,14,469,469,0 +"170","R/fisher_information.R","fi_pool_cluster",406,7,406,18,7,18,470,470,0 +"171","R/fisher_information.R","fi_pool_cluster",407,7,407,19,7,19,471,471,0 +"172","R/fisher_information.R","fi_pool_cluster",408,7,408,16,7,16,472,472,0 +"173","R/fisher_information.R","fi_pool_cluster",409,7,409,24,7,24,473,473,0 +"174","R/fisher_information.R","fi_pool_cluster",410,7,410,17,7,17,474,474,0 +"175","R/fisher_information.R","fi_pool_cluster",411,7,411,150,7,150,475,475,0 +"176","R/fisher_information.R","fi_pool_cluster",414,5,421,5,5,5,478,485,2 +"177","R/fisher_information.R","fi_pool_cluster",422,9,422,18,9,18,422,422,2 +"178","R/fisher_information.R","fi_pool_cluster",423,7,423,16,7,16,487,487,0 +"179","R/fisher_information.R","fi_pool_cluster",425,7,427,7,7,7,489,491,2 +"180","R/fisher_information.R","fi_pool_cluster",426,9,426,78,9,78,490,490,48 +"181","R/fisher_information.R","fi_pool_cluster",429,7,431,7,7,7,493,495,2 +"182","R/fisher_information.R","fi_pool_cluster",430,9,430,94,9,94,494,494,48 +"183","R/fisher_information.R","fi_pool_cluster",434,7,436,7,7,7,498,500,2 +"184","R/fisher_information.R","fi_pool_cluster",435,9,435,80,9,80,499,499,48 +"185","R/fisher_information.R","fi_pool_cluster",438,7,440,7,7,7,502,504,2 +"186","R/fisher_information.R","fi_pool_cluster",439,9,439,96,9,96,503,503,48 +"187","R/fisher_information.R","fi_pool_cluster",442,7,442,36,7,36,506,506,2 +"188","R/fisher_information.R","fi_pool_cluster",443,7,443,106,7,106,507,507,2 +"189","R/fisher_information.R","fi_pool_cluster",444,7,444,112,7,112,508,508,2 +"190","R/fisher_information.R","fi_pool_cluster",445,7,445,102,7,102,509,509,2 +"191","R/fisher_information.R","fi_pool_cluster",446,7,446,103,7,103,510,510,2 +"192","R/fisher_information.R","fi_pool_cluster",447,7,447,108,7,108,511,511,2 +"193","R/fisher_information.R","fi_pool_cluster",448,7,448,112,7,112,512,512,2 +"194","R/fisher_information.R","fi_pool_cluster",451,7,457,8,7,8,515,521,2 +"195","R/fisher_information.R","fi_pool_cluster",459,7,459,31,7,31,523,523,2 +"196","R/fisher_information.R","fi_pool_cluster",462,5,462,126,5,126,526,526,0 +"197","R/optimise_prevalence.R","optimise_s_prevalence",74,3,74,18,3,18,603,603,16 +"198","R/optimise_prevalence.R","optimise_s_prevalence",76,7,76,24,7,24,76,76,16 +"199","R/optimise_prevalence.R","optimise_s_prevalence",77,5,79,67,5,67,606,608,1 +"200","R/optimise_prevalence.R","optimise_s_prevalence",81,7,81,18,7,18,81,81,15 +"201","R/optimise_prevalence.R","optimise_s_prevalence",81,21,81,56,21,56,81,81,1 +"202","R/optimise_prevalence.R","optimise_s_prevalence",83,3,83,23,3,23,612,612,14 +"203","R/optimise_prevalence.R","optimise_s_prevalence",93,7,93,22,7,22,93,93,14 +"204","R/optimise_prevalence.R","optimise_s_prevalence",94,5,94,18,5,18,623,623,2 +"205","R/optimise_prevalence.R","optimise_s_prevalence",95,5,95,18,5,18,624,624,2 +"206","R/optimise_prevalence.R","optimise_s_prevalence",96,5,96,24,5,24,625,625,2 +"207","R/optimise_prevalence.R","optimise_s_prevalence",106,7,106,22,7,22,106,106,14 +"208","R/optimise_prevalence.R","optimise_s_prevalence",107,5,107,18,5,18,636,636,1 +"209","R/optimise_prevalence.R","optimise_s_prevalence",108,5,108,18,5,18,637,637,1 +"210","R/optimise_prevalence.R","optimise_s_prevalence",109,5,109,24,5,24,638,638,1 +"211","R/optimise_prevalence.R","optimise_s_prevalence",111,7,111,24,7,24,111,111,14 +"212","R/optimise_prevalence.R","optimise_s_prevalence",112,5,115,5,5,5,641,644,9 +"213","R/optimise_prevalence.R","optimise_s_prevalence",113,7,113,83,7,83,642,642,336 +"214","R/optimise_prevalence.R","optimise_s_prevalence",114,7,114,9,7,9,643,643,336 +"215","R/optimise_prevalence.R","optimise_s_prevalence",117,5,127,5,5,5,646,656,5 +"216","R/optimise_prevalence.R","optimise_s_prevalence",118,7,125,7,7,7,647,654,103 +"217","R/optimise_prevalence.R","optimise_s_prevalence",126,7,126,9,7,9,655,655,102 +"218","R/optimise_prevalence.R","optimise_s_prevalence",130,3,130,43,3,43,659,659,14 +"219","R/optimise_prevalence.R","optimise_s_prevalence",131,3,131,48,3,48,660,660,13 +"220","R/optimise_prevalence.R","optimise_s_prevalence",132,3,132,44,3,44,661,661,13 +"221","R/optimise_prevalence.R","optimise_s_prevalence",134,7,134,39,7,39,134,134,13 +"222","R/optimise_prevalence.R","optimise_s_prevalence",135,5,135,29,5,29,664,664,5 +"223","R/optimise_prevalence.R","optimise_s_prevalence",136,5,136,32,5,32,665,665,5 +"224","R/optimise_prevalence.R","optimise_s_prevalence",138,5,138,27,5,27,667,667,8 +"225","R/optimise_prevalence.R","optimise_s_prevalence",139,5,139,30,5,30,668,668,8 +"226","R/optimise_prevalence.R","optimise_s_prevalence",142,7,142,16,7,16,142,142,13 +"227","R/optimise_prevalence.R","optimise_s_prevalence",142,19,142,139,19,139,142,142,1 +"228","R/optimise_prevalence.R","optimise_s_prevalence",144,7,144,19,7,19,144,144,13 +"229","R/optimise_prevalence.R","optimise_s_prevalence",145,9,145,20,9,20,145,145,8 +"230","R/optimise_prevalence.R","optimise_s_prevalence",145,23,145,36,23,36,145,145,1 +"231","R/optimise_prevalence.R","optimise_s_prevalence",146,5,146,55,5,55,675,675,8 +"232","R/optimise_prevalence.R","optimise_s_prevalence",147,14,147,25,14,25,147,147,5 +"233","R/optimise_prevalence.R","optimise_s_prevalence",148,5,148,41,5,41,677,677,5 +"234","R/optimise_prevalence.R","optimise_s_prevalence",149,9,149,26,9,26,149,149,5 +"235","R/optimise_prevalence.R","optimise_s_prevalence",150,7,150,16,7,16,679,679,2 +"236","R/optimise_prevalence.R","optimise_s_prevalence",152,7,154,23,7,23,681,683,3 +"237","R/optimise_prevalence.R","optimise_s_prevalence",153,9,153,26,9,26,682,682,26 +"238","R/optimise_prevalence.R","optimise_s_prevalence",156,9,156,30,9,30,156,156,5 +"239","R/optimise_prevalence.R","optimise_s_prevalence",157,7,157,20,7,20,686,686,1 +"240","R/optimise_prevalence.R","optimise_s_prevalence",158,7,158,132,7,132,687,687,1 +"241","R/optimise_prevalence.R","optimise_s_prevalence",160,7,162,27,7,27,689,691,4 +"242","R/optimise_prevalence.R","optimise_s_prevalence",161,9,161,26,9,26,690,690,52 +"243","R/optimise_prevalence.R","optimise_s_prevalence",164,9,164,20,9,20,164,164,5 +"244","R/optimise_prevalence.R","optimise_s_prevalence",165,7,165,20,7,20,694,694,2 +"245","R/optimise_prevalence.R","optimise_s_prevalence",166,7,166,25,7,25,695,695,2 +"246","R/optimise_prevalence.R","optimise_s_prevalence",168,7,168,50,7,50,697,697,3 +"247","R/optimise_prevalence.R","optimise_s_prevalence",170,5,177,5,5,5,699,706,5 +"248","R/optimise_prevalence.R","optimise_s_prevalence",179,3,179,5,3,5,708,708,5 +"249","R/optimise_prevalence.R","optimise_sN_prevalence",196,7,196,44,7,44,196,196,3 +"250","R/optimise_prevalence.R","optimise_sN_prevalence",197,5,200,5,5,5,726,729,1 +"251","R/optimise_prevalence.R","optimise_sN_prevalence",202,5,202,48,5,48,731,731,1 +"252","R/optimise_prevalence.R","optimise_sN_prevalence",203,5,203,22,5,22,732,732,1 +"253","R/optimise_prevalence.R","optimise_sN_prevalence",205,5,205,13,5,13,734,734,2 +"254","R/optimise_prevalence.R","optimise_sN_prevalence",206,5,206,27,5,27,735,735,2 +"255","R/optimise_prevalence.R","optimise_sN_prevalence",207,5,219,5,5,5,736,748,2 +"256","R/optimise_prevalence.R","optimise_sN_prevalence",208,7,211,7,7,7,737,740,4 +"257","R/optimise_prevalence.R","optimise_sN_prevalence",213,11,213,33,11,33,213,213,4 +"258","R/optimise_prevalence.R","optimise_sN_prevalence",214,9,214,13,9,13,743,743,2 +"259","R/optimise_prevalence.R","optimise_sN_prevalence",216,9,216,24,9,24,745,745,2 +"260","R/optimise_prevalence.R","optimise_sN_prevalence",217,9,217,22,9,22,746,746,2 +"261","R/optimise_prevalence.R","optimise_sN_prevalence",220,5,220,17,5,17,749,749,2 +"262","R/optimise_prevalence.R","optimise_sN_prevalence",221,9,221,22,9,22,221,221,2 +"263","R/optimise_prevalence.R","optimise_sN_prevalence",222,7,222,129,7,129,751,751,0 +"264","R/optimise_prevalence.R","optimise_sN_prevalence",224,9,224,22,9,22,224,224,2 +"265","R/optimise_prevalence.R","optimise_sN_prevalence",225,7,225,127,7,127,754,754,0 +"266","R/optimise_prevalence.R","optimise_sN_prevalence",229,3,229,5,3,5,758,758,3 +"267","R/optimise_prevalence.R","cost_fi",233,3,234,60,3,60,762,763,336 +"268","R/optimise_prevalence.R","cost_fi_cluster",247,3,247,16,3,16,776,776,103 +"269","R/optimise_prevalence.R","cost_fi_cluster",248,3,248,18,3,18,777,777,103 +"270","R/optimise_prevalence.R","cost_fi_cluster",250,3,250,86,3,86,779,779,103 +"271","R/optimise_prevalence.R","cost_fi_cluster",251,3,251,68,3,68,780,780,102 +"272","R/optimise_prevalence.R","cost_fi_cluster",253,3,253,24,3,24,782,782,102 +"273","R/util.R","cloglog",5,3,5,18,3,18,789,789,2 +"274","R/util.R","cloglog_inv",8,3,8,18,3,18,792,792,29878 +"275","R/util.R","mu_sigma_linknorm",14,6,14,31,6,31,798,798,2 +"276","R/util.R","mu_sigma_linknorm",15,5,15,69,5,69,799,799,0 +"277","R/util.R","mu_sigma_linknorm",17,3,17,26,3,26,801,801,2 +"278","R/util.R","mu_sigma_linknorm",18,3,18,14,3,14,802,802,2 +"279","R/util.R","mu_sigma_linknorm",19,3,27,3,3,3,803,811,2 +"280","R/util.R","mu_sigma_linknorm",20,5,20,14,5,14,804,804,338 +"281","R/util.R","mu_sigma_linknorm",21,5,21,22,5,22,805,805,338 +"282","R/util.R","mu_sigma_linknorm",22,5,22,75,5,75,806,806,338 +"283","R/util.R","mu_sigma_linknorm",23,5,23,71,5,71,807,807,338 +"284","R/util.R","mu_sigma_linknorm",24,5,24,86,5,86,808,808,338 +"285","R/util.R","mu_sigma_linknorm",25,5,25,71,5,71,809,809,338 +"286","R/util.R","mu_sigma_linknorm",26,5,26,46,5,46,810,810,338 +"287","R/util.R","mu_sigma_linknorm",28,3,28,84,3,84,812,812,2 +"288","R/util.R","mu_sigma_linknorm",29,3,29,23,3,23,813,813,2 +"289","R/util.R","mu_sigma_linknorm",30,3,30,5,3,5,814,814,2 diff --git a/dependencies/dep.png b/dev_resources/dep.png similarity index 100% rename from dependencies/dep.png rename to dev_resources/dep.png diff --git a/man/hello.Rd b/man/hello.Rd deleted file mode 100644 index 0fa7c4b..0000000 --- a/man/hello.Rd +++ /dev/null @@ -1,12 +0,0 @@ -\name{hello} -\alias{hello} -\title{Hello, World!} -\usage{ -hello() -} -\description{ -Prints 'Hello, world!'. -} -\examples{ -hello() -} diff --git a/tests/testthat/test-design_effect.R b/tests/testthat/test-design_effect.R index e75f9ea..d43f96d 100644 --- a/tests/testthat/test-design_effect.R +++ b/tests/testthat/test-design_effect.R @@ -1,4 +1,15 @@ test_that("design_effect() gives consistent output for basic tests", { + # This one has reasonable inputs + expect_equal( + design_effect( + pool_size = 5, + pool_number = 10, + prevalence = 0.01, + correlation = 0.05, + sensitivity = 0.99, + specificity = 0.95), + 0.7240988, tolerance = 1e-7 + ) expect_equal( design_effect( pool_size = 10, diff --git a/tests/testthat/test-optimise_prevalence.R b/tests/testthat/test-optimise_prevalence.R index 07b0061..08c0c23 100644 --- a/tests/testthat/test-optimise_prevalence.R +++ b/tests/testthat/test-optimise_prevalence.R @@ -1,4 +1,11 @@ test_that("optimise_sN_prevalence() gives consistent output for basic tests", { + # Reasonable params + expect_true(all.equal( + optimise_sN_prevalence( + prevalence = 0.01, cost_unit = 5, cost_pool = 10, + cost_cluster = 100, correlation = 0.05 + ), list(s=5,cost =0.2513798, catch=20, N=4),tolerance=1e-7)) + # Rest not so much expect_true(all.equal( optimise_sN_prevalence( prevalence = 0.9, @@ -31,7 +38,7 @@ test_that("optimise_sN_prevalence() gives consistent output for basic tests", { )) }) -test_that("optimise_sN_prevalence() basic tests when correlation == 0 (flow control)", { +test_that("optimise_sN_prevalence() when correlation == 0", { expect_true(all.equal( optimise_sN_prevalence( prevalence = 0.9, @@ -49,7 +56,33 @@ test_that("optimise_sN_prevalence() basic tests when correlation == 0 (flow cont )) }) +test_that("optimise_sN_prevalence() when opt$N == max_N", { + expect_warning( + optimise_sN_prevalence( + prevalence = 0.01, cost_unit = 5, cost_pool = 10, + cost_cluster = 100, correlation = 0.05, max_N = 4), + "Maximum cost effectivness is achieved at or above the maximum number of pools allowed. Consider increasing max_N") +}) + +# TODO: fix this +#test_that("optimise_sN_prevalence() when opt$s == max_s", { +# # Not an amazing text, catches all the optimise_s_prevalence() warnings too +# tryCatch( +# optimise_sN_prevalence( +# prevalence = 0.01, cost_unit = 5, cost_pool = 10, +# cost_cluster = 100, correlation = 0.05, max_s = 5) +# ) +# expect_warning() +# +#}) + test_that("optimise_s_prevalence() gives consistent output for basic tests", { + # Reasonable parameters + expect_true(all.equal( + optimise_s_prevalence(prevalence = 0.01, cost_unit = 5, cost_pool = 10), + list(s=19, cost=0.05998076, catch=19), tolerance = 1e-7 + )) + # Not very expect_true(all.equal( optimise_s_prevalence( prevalence = 0.7, cost_unit = 10, cost_pool = 100, @@ -72,7 +105,42 @@ test_that("optimise_s_prevalence() gives consistent output for basic tests", { )) }) +test_that("optimise_s_prevalence() throws error when form == 'discrete'", { + expect_error(optimise_s_prevalence( + prevalence = 0.01, cost_unit = 5, cost_pool = 10, form = "discrete"), + 'When form = "discrete" the cost of unit information function with + respect to s often has mulitple minima and therefore the discrete + distribution is not currently supported for optimisation') +}) + +test_that("optimise_s_prevalence() when cost_unit == Inf", { + expect_true(all.equal( + optimise_s_prevalence(prevalence = 0.01, cost_unit = Inf, cost_pool = 10, interval = 0.1), + list(s=1, cost=NA, catch=1, s_interval=c(1,19), cost_interval=NA, catch_interval=c(1,19)) + )) +}) + +test_that("optimise_s_prevalence() when cost_pool == Inf", { + expect_true(all.equal( + optimise_s_prevalence(prevalence = 0.1, cost_unit = 5, cost_pool = Inf, interval = 0.1), + list(s=15, cost=NA, catch=15, s_interval=c(10,21), cost_interval=NA, catch_interval=c(10,21)) + )) +}) + +test_that("optimise_s_prevalence() hits max_s when determining cost floor/ceiling", { + expect_warning( + optimise_s_prevalence(prevalence = 0.01, cost_unit = 5, cost_pool = Inf, max_s = 50), + 'Maximum cost effectivness is achieved at or above the maximum size of pools allowed. Consider increasing max_s') +}) + +test_that("optimise_s_prevalence() when cost(max_s) < max_cost", { + expect_warning( + optimise_s_prevalence(prevalence = 0.1, cost_pool = 1, cost_unit = 0.5, max_s = 6, interval = 0.1), + 'A pool size greater than max_s may fall within the specified range of cost effectiveness. Consider increasing max_s') +}) + test_that("optimise_s_prevalence() extremely bad integrand behaviour", { + # This takes a few seconds to run expect_error( optimise_s_prevalence( prevalence = 0.2, cost_unit = 1, cost_pool = 200, diff --git a/tests/testthat/test-util.R b/tests/testthat/test-util.R new file mode 100644 index 0000000..d359ffe --- /dev/null +++ b/tests/testthat/test-util.R @@ -0,0 +1,11 @@ +# As util helper functions will be used to catch warnings soon +test_that("interval is >= 0", { + expect_error( + optimise_s_prevalence(prevalence = 0.01, cost_unit = 5, cost_pool = 10, interval = -1), + 'interval must be 0 or higher') + expect_equal( + optimise_s_prevalence(prevalence = 0.1, cost_unit = 5, cost_pool = 10, interval = 2), + list(s=5, cost=0.786439, catch =5, s_interval=c(1,25), + cost_interval=c(1.35, 2.262155), catch_interval=c(1,25)), + tolerance = 1e-7) +})