Skip to content

Commit dd64b73

Browse files
committed
Clean up import section
1 parent 5d2019e commit dd64b73

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

DESCRIPTION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Imports:
2525
Suggests:
2626
ggcorrplot,
2727
growthstandards,
28+
grDevices,
2829
knitr,
2930
MASS,
3031
mvtnorm,

NAMESPACE

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,19 @@ importFrom(ggplot2,xlim)
4242
importFrom(ggplot2,ylab)
4343
importFrom(ggplot2,ylim)
4444
importFrom(hardhat,default_xy_blueprint)
45+
importFrom(hardhat,forge)
4546
importFrom(hardhat,mold)
4647
importFrom(hardhat,new_model)
48+
importFrom(hardhat,spruce_numeric)
49+
importFrom(hardhat,validate_prediction_size)
4750
importFrom(lme4,VarCorr)
4851
importFrom(lme4,fixef)
4952
importFrom(lme4,lmer)
5053
importFrom(lme4,lmerControl)
5154
importFrom(lme4,ranef)
5255
importFrom(matrixsampling,rwishart)
5356
importFrom(rlang,.data)
57+
importFrom(rlang,arg_match)
5458
importFrom(splines,bs)
5559
importFrom(stats,approx)
5660
importFrom(stats,as.formula)
@@ -71,4 +75,5 @@ importFrom(stats,rnorm)
7175
importFrom(stats,setNames)
7276
importFrom(stats,smooth)
7377
importFrom(stats,var)
78+
importFrom(tidyr,drop_na)
7479
importFrom(tidyr,pivot_wider)

R/brokenstick-package.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22
#' mutate pull relocate select ungroup `%>%`
33
#' @importFrom ggplot2 aes_string facet_wrap geom_line geom_point
44
#' geom_step ggplot xlab xlim ylab ylim
5-
#' @importFrom hardhat mold new_model default_xy_blueprint
5+
#' @importFrom hardhat default_xy_blueprint forge mold new_model
6+
#' spruce_numeric validate_prediction_size
67
#' @importFrom lme4 fixef lmer lmerControl ranef VarCorr
78
#' @importFrom matrixsampling rwishart
8-
#' @importFrom rlang .data
9+
#' @importFrom rlang .data arg_match
910
#' @importFrom splines bs
1011
#' @importFrom stats approx as.formula cor cov2cor
1112
#' fitted model.frame lm
1213
#' model.matrix na.exclude na.omit
1314
#' optim
1415
#' predict quantile rgamma rnorm
1516
#' rWishart setNames smooth var
16-
#' @importFrom tidyr pivot_wider
17+
#' @importFrom tidyr drop_na pivot_wider
1718
NULL
1819

1920
#' \pkg{brokenstick}: A package for irregular longitudinal data.

R/brokenstick-predict.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ predict.brokenstick <- function(object, new_data = NULL, type = "numeric",
127127
reset <- TRUE
128128
}
129129

130-
forged <- hardhat::forge(new_data, object$blueprint, outcomes = TRUE)
131-
rlang::arg_match(type, valid_predict_types())
130+
forged <- forge(new_data, object$blueprint, outcomes = TRUE)
131+
arg_match(type, valid_predict_types())
132132
p <- predict_brokenstick_bridge(type, object,
133133
forged$predictors,
134134
forged$outcomes,
@@ -174,7 +174,7 @@ predict_brokenstick_bridge <- function(type, model, x, y, g) {
174174
predict_function <- get_predict_function(type)
175175
yhat <- predict_function(model, x, y, g)
176176

177-
hardhat::validate_prediction_size(yhat, x)
177+
validate_prediction_size(yhat, x)
178178

179179
yhat
180180
}
@@ -237,5 +237,5 @@ predict_brokenstick_numeric <- function(object, x, y, g) {
237237
filter(!.data$knot) %>%
238238
pull("yhat")
239239

240-
hardhat::spruce_numeric(pred)
240+
spruce_numeric(pred)
241241
}

0 commit comments

Comments
 (0)