Skip to content

Commit

Permalink
unbreak the breakage
Browse files Browse the repository at this point in the history
  • Loading branch information
nhejazi committed Feb 8, 2018
1 parent f723d4e commit 304f956
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions R/adaptest.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ data_adapt <- function(Y,
negative,
parameter_wrapper,
SL_lib) {
if (!data.table::is.data.table(Y)) {
if (!is.data.frame(Y)) {
if (!is.matrix(Y)) {
stop("Argument Y must be a data.frame or a matrix.")
}
Y <- (Y)
Y <- as.matrix(Y)
}
if (!is.vector(A)) stop("Argument A must be numeric.")
if (!is.null(W)) if (!is.matrix(W)) stop("Argument W must be matrix.")
Expand Down Expand Up @@ -362,7 +362,6 @@ adaptest <- function(Y,
#' @param SL_lib character of \code{SuperLearner} library
#'
#' @importFrom origami training validation
#' @importFrom data.table as.data.table
#' @importFrom tmle tmle
#
cv_param_est <- function(fold,
Expand All @@ -375,18 +374,19 @@ cv_param_est <- function(fold,
Y_name,
A_name,
W_name) {

# define training and validation sets based on input object of class "folds"
param_data <- origami::training(data)
estim_data <- origami::validation(data)

# get param generating data (NOTE: these are data.table's)
A_param <- param_data[, grep(A_name, colnames(data))]
Y_param <- param_data[, grep(Y_name, colnames(data))]
W_param <- param_data[, grep(W_name, colnames(data))]
W_param <- param_data[, grep(W_name, colnames(data)), FALSE]
# get estimation data (NOTE: these are data.table's)
A_estim <- estim_data[, grep(A_name, colnames(data))]
Y_estim <- estim_data[, grep(Y_name, colnames(data))]
W_estim <- estim_data[, grep(W_name, colnames(data))]
W_estim <- estim_data[, grep(W_name, colnames(data)), FALSE]

# generate data-adaptive target parameter
data_adaptive_index <- parameter_wrapper(
Expand Down

0 comments on commit 304f956

Please sign in to comment.