R/interpret.SpATS.formula.R

Defines functions interpret.SpATS.formula

interpret.SpATS.formula <-
function(formula) {
    env <- environment(formula) 
    if(inherits(formula, "character"))          
        formula <- as.formula(formula)
    tf <- terms.formula(formula, specials = c("SAP", "PSANOVA"))
    terms <- attr(tf, "term.labels")
    nt <- length(terms)
    if(nt != 1)
    	stop("Error in the specification of the spatial effect: only a sigle bidimensional function is allowed")
    
    res <- eval(parse(text = terms[1]), envir = env)
    res
}

Try the SpATS package in your browser

Any scripts or data that you put into this service are public.

SpATS documentation built on Nov. 10, 2022, 5:58 p.m.