From f1f50098ac06dd3c50dc4f20804917f9d8bb677c Mon Sep 17 00:00:00 2001 From: mjemons Date: Tue, 28 Oct 2025 15:39:05 +0100 Subject: [PATCH] fix environemnt problems --- R/spatialInference.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/spatialInference.R b/R/spatialInference.R index 70379af..61ab39a 100644 --- a/R/spatialInference.R +++ b/R/spatialInference.R @@ -197,13 +197,13 @@ spatialInference <- function(spe, colnames(mm) <- gsub("-","_", colnames(mm)) #create a formula without the first intercept column formula <- stats::as.formula(paste("Y ~", paste(colnames(mm)[c(-1)], - collapse="+"))) + collapse="+")), env = emptyenv()) if(!is.null(sample_id)){ formula <- stats::as.formula(paste("Y ~", paste(c(colnames(mm)[c(-1)], paste0("s(",sample_id,", bs = 're')")), - collapse="+"))) + collapse="+")), env = emptyenv()) } #due to the removal of delta, rSeq can be less as well @@ -440,7 +440,7 @@ exchangeSplineBasis <- function(mdl, var, bs){ formulaVars <- formula.tools::rhs.vars(mdl$formula) formulaVars[1] <- newIntercept - newFormula <- stats::as.formula(paste("Y ~ ", paste(formulaVars, collapse = "+"))) + newFormula <- stats::as.formula(paste("Y ~ ", paste(formulaVars, collapse = "+")), env = emptyenv()) return(newFormula) } \ No newline at end of file