Skip to content

Commit

Permalink
🐛 Drop sf in engines
Browse files Browse the repository at this point in the history
  • Loading branch information
mhesselbarth committed Oct 23, 2023
1 parent 216e2b9 commit c2db82b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion R/engine_bart.R
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,8 @@ engine_bart <- function(x,

# All other needed data for model fitting
equation <- model$biodiversity[[1]]$equation
data <- cbind(model$biodiversity[[1]]$predictors, data.frame(observed = model$biodiversity[[1]]$observations[,'observed']) )
data <- cbind(model$biodiversity[[1]]$predictors,
data.frame(observed = model$biodiversity[[1]]$observations[,'observed', drop = TRUE]) )
# Subset to predictor names
data <- subset(data, select = c('observed', model$biodiversity[[1]]$predictors_names) )
if(model$biodiversity[[1]]$family=='binomial') data$observed <- factor(data$observed)
Expand Down
2 changes: 1 addition & 1 deletion R/engine_breg.R
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ engine_breg <- function(x,
if(!is.null(li)) if(getOption('ibis.setupmessages')) myLog('[Estimation]','red',paste0("Package does not support custom link functions. Ignored!"))
form <- model$biodiversity[[1]]$equation
df <- cbind(model$biodiversity[[1]]$predictors,
data.frame(observed = model$biodiversity[[1]]$observations[,'observed'])
data.frame(observed = model$biodiversity[[1]]$observations[,'observed', drop = TRUE])
)
df <- subset(df, select = c(model$biodiversity[[1]]$predictors_names, "observed"))
w <- model$biodiversity[[1]]$expect # The expected exposure
Expand Down
3 changes: 2 additions & 1 deletion R/engine_gdb.R
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ engine_gdb <- function(x,

# All other needed data for model fitting
equation <- model$biodiversity[[1]]$equation
data <- cbind(model$biodiversity[[1]]$predictors, data.frame(observed = model$biodiversity[[1]]$observations[,'observed']) )
data <- cbind(model$biodiversity[[1]]$predictors,
data.frame(observed = model$biodiversity[[1]]$observations[,'observed', drop = TRUE]) )
w <- model$biodiversity[[1]]$expect

# Select predictors
Expand Down
2 changes: 1 addition & 1 deletion R/engine_glmnet.R
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ engine_glmnet <- function(x,

form <- model$biodiversity[[1]]$equation
df <- cbind(model$biodiversity[[1]]$predictors,
data.frame(observed = model$biodiversity[[1]]$observations[,'observed'])
data.frame(observed = model$biodiversity[[1]]$observations[,'observed', drop = TRUE])
)
df <- subset(df, select = c(model$biodiversity[[1]]$predictors_names, "observed"))
w <- df$w <- model$biodiversity[[1]]$expect # The expected exposure
Expand Down

0 comments on commit c2db82b

Please sign in to comment.