Revision 0d54c223814f3b1cd7515490af55d9e099a134f4 authored by Edzer J. Pebesma on 13 April 2007, 14:45:18 UTC, committed by cran-robot on 13 April 2007, 14:45:18 UTC
1 parent ee38f00
Raw File
gstat.formula.R
# $Id: gstat.formula.q,v 1.7 2006-02-10 19:01:07 edzer Exp $

"gstat.formula" <-
function (formula, data)
{
    m = model.frame(terms(formula), as(data, "data.frame"))
    Y = model.extract(m, response)
    if (length(Y) == 0)
        stop("no response variable present in formula")
    Terms = attr(m, "terms")
    X = model.matrix(Terms, m)
    has.intercept = attr(Terms, "intercept")

	if (gridded(data))
		grid = gridparameters(data)
	else
		grid = numeric(0)

    list(y = Y, locations = coordinates(data), X = X, call = call,
        has.intercept = has.intercept, grid = as.double(unlist(grid)))
}
back to top