Skip to content

Commit

Permalink
cran prep
Browse files Browse the repository at this point in the history
  • Loading branch information
graemeblair committed Nov 8, 2018
1 parent 39ebdf2 commit 1e1e7c7
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 21 deletions.
2 changes: 0 additions & 2 deletions DESCRIPTION
Expand Up @@ -20,8 +20,6 @@ Depends:
estimatr (>= 0.10.0)
Imports:
rlang, generics
Remotes:
DeclareDesign/DesignLibrary
License: MIT + file LICENSE
URL: https://declaredesign.org, https://github.com/DeclareDesign/DeclareDesign
BugReports: https://github.com/DeclareDesign/DeclareDesign/issues
Expand Down
5 changes: 2 additions & 3 deletions R/expand_design.R
Expand Up @@ -11,6 +11,8 @@
#' @return if set of designs is size one, the design, otherwise a `by`-list of designs. Designs are given a parameters attribute with the values of parameters assigned by expand_design.
#'
#' @examples
#'
#' \dontrun{
#'
#' # in conjunction with DesignLibrary
#'
Expand All @@ -32,15 +34,12 @@
#' # returns list of eight designs
#' designs <- expand_design(designer, N = seq(30, 100, 10))
#'
#' \dontrun{
#' # diagnose a list of designs created by expand_design or redesign
#' diagnosis <- diagnose_design(designs, sims = 50)
#' }
#'
#' # returns a single design
#' large_design <- expand_design(designer, N = 200)
#'
#' \dontrun{
#' diagnose_large_design <- diagnose_design(large_design, sims = 50)
#' }
#'
Expand Down
5 changes: 2 additions & 3 deletions man/expand_design.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions tests/testthat/test-design-library.R
Expand Up @@ -13,6 +13,9 @@ test_that("design library dependency works",{
})



# fan out

test_that("MH sim ids", {
skip_if_not_installed("DesignLibrary")
skip_on_cran()
Expand All @@ -27,3 +30,16 @@ test_that("MH sim ids", {
expect_equal(sx$estimate[1], sx$estimate[2])
expect_equal(sx$estimate[3], sx$estimate[4])
})


test_that("fan out IDs are correct", {

skip_if_not_installed("DesignLibrary")

sims <- c(30, 1, 2, 1, 1, 2)
design <- DesignLibrary::two_arm_designer(rho = 0)

sx <- simulate_design(design, sims = sims)

expect_equivalent(vapply(sx[c("step_1_draw", "step_3_draw", "step_6_draw")], max, 0), c(30, 60, 120))
})
13 changes: 0 additions & 13 deletions tests/testthat/test-simulate-design.R
Expand Up @@ -93,19 +93,6 @@ test_that("no estimates estimands declared", {
})


test_that("fan out IDs are correct", {

skip_if_not_installed("DesignLibrary")

sims <- c(30, 1, 2, 1, 1, 2)
design <- DesignLibrary::two_arm_designer(rho = 0)

sx <- simulate_design(design, sims = sims)

expect_equivalent(vapply(sx[c("step_1_draw", "step_3_draw", "step_6_draw")], max, 0), c(30, 60, 120))
})


test_that("designs with some estimators that don't have p.values return the p.values for the estimators that do have them", {
my_custom_estimator <- function(data) return(data.frame(estimate = 5))

Expand Down

0 comments on commit 1e1e7c7

Please sign in to comment.