Skip to content

Commit 6ad5891

Browse files
committed
fix imports
1 parent 4bf58e7 commit 6ad5891

5 files changed

+18
-7
lines changed

DESCRIPTION

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ Imports:
1818
dynwrap (>= 1.0.0),
1919
igraph,
2020
magrittr,
21+
methods,
2122
mvtnorm,
2223
purrr,
2324
stats,
2425
testthat,
2526
tibble,
26-
tidyr
27+
tidyr,
28+
utils
2729
Suggests:
2830
dynnormaliser (>= 0.9.9)
2931
Remotes:

NAMESPACE

+6-1
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,10 @@ importFrom(dynwrap,add_prior_information)
2929
importFrom(magrittr,"%$%")
3030
importFrom(magrittr,"%<>%")
3131
importFrom(magrittr,set_colnames)
32+
importFrom(methods,formalArgs)
33+
importFrom(stats,dexp)
34+
importFrom(stats,rbinom)
35+
importFrom(stats,rnbinom)
3236
importFrom(stats,runif)
33-
importFrom(testthat,expect_gte)
37+
importFrom(utils,head)
38+
importFrom(utils,tail)

R/1-topology_models.R

+7-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ general_graph_model_fun <- function(
88
if (is.function(num_modifications)) num_modifications <- num_modifications()
99
if (is.function(max_degree)) max_degree <- max_degree()
1010

11-
testthat::expect_gte(num_modifications, 1)
11+
assert_that(
12+
num_modifications >= 1,
13+
max_degree >= 3
14+
)
1215
testthat::expect_gte(max_degree, 3)
1316

1417
milnet <- tribble(
@@ -88,13 +91,14 @@ general_graph_model_fun <- function(
8891

8992
#' @param num_milestones The number of milestones in the trajectory (linear, cyclic)
9093
#' @rdname topology_models
94+
#' @importFrom utils head tail
9195
#' @export
9296
model_linear <- function(
9397
num_milestones = function() rbinom(1, size = 10, .25) + 2
9498
) {
9599
if (is.function(num_milestones)) num_milestones <- num_milestones()
96100

97-
testthat::expect_gte(num_milestones, 2)
101+
assert_that(num_milestones >= 2)
98102

99103
milestone_ids <- paste0("M", seq_len(num_milestones))
100104
tibble(
@@ -110,7 +114,7 @@ model_cyclic <- function(
110114
) {
111115
if (is.function(num_milestones)) num_milestones <- num_milestones()
112116

113-
testthat::expect_gte(num_milestones, 3)
117+
assert_that(num_milestones >= 3)
114118

115119
topology_models$linear(num_milestones) %>%
116120
add_row(from = paste0("M", num_milestones), to = "M1")

R/2-generate_milestone_network.R

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#' @param ... Parameters to pass to other models. Can be in the form of `linear = list(num_milestones = function() sample(2:8, 1)` or just `num_milestones = 10`.
1010
#'
1111
#' @export
12+
#' @importFrom methods formalArgs
1213
generate_milestone_network <- function(
1314
model = names(topology_models),
1415
...

R/package.R

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
#' @import purrr
99
#' @importFrom assertthat assert_that
1010
#' @importFrom magrittr %<>% %$% set_colnames
11-
#' @importFrom stats runif
12-
#' @importFrom testthat expect_gte
11+
#' @importFrom stats runif rbinom rnbinom dexp
1312
#'
1413
#' @docType package
1514
#' @name dyntoy

0 commit comments

Comments
 (0)