trend.spatial: Builds the Trend Matrix
Description
Builds the trend matrix according to the specification
  of the mean part of the model provided by the user.Usage
trend.spatial(trend, geodata)
Arguments
trend
specifies the mean part of the model.
    See DETAILS below.
geodata
an object of the class geodata as described in
    as.geodata. Value
- An $n \times p$ trend matrix where $n$
  is the number of spatial
  locations and $p$ is the number of mean parameters in the model.
itemize
- trend = "1st"and- trend = ~ x1 + x2
- trend = "2nd"and- trend = ~ x1 + x2 + x1^2 +
      x2^2 + x1*x2
bold
Search path for covariatescr
Typically, functions in the package geoR which calls
  trend.spatial will have the arguments goedata,
  coords and data.   When the trend is specifed as trend = ~ model
  the terms included in the model will be searched for in the following
  loactions (in this order):
  
- as elements of the listgeodata
- as columns in the data-framegeodata$covariates
- as columns in the data-framegeodata$data
Details
The implicty model assumes that there is an underlying process
  with mean $\mu(x)$, where $x = (x_1, x_2)$ denotes the coordinates
  of a spatial location.
  The argument trend defines the form of the mean with the
  following options:  
{the mean is assumed to be constant over the region,
      in which case $\mu(x)= \mu$. This is the default
      option.  }
    - "1st"
{the mean is assumed to be a first degree polynomial
      on the coordinates:
      $$\mu(x)= \beta_0 + \beta_1 x_1 + \beta_2 x_2$$}- "2nd"
{the mean is assumed to be a second degree polynomial
      on the coordinates:
      $$\mu(x)= \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \beta_1 (x_1)^2 +
	\beta_2 (x_2)^2 + \beta_1 x_1 * \beta_2 x_2$$}- ~ model
{a model specification. Seeformula for further details on how to specify
      a model using formulas. Notice that the model term before
      ~ is not necessary. Tipically used to include covariates
      (external trend) in the model.}References
Further information about geoR can be found at:
http://www.maths.lancs.ac.uk/~ribeiro/geoR.