Learn R Programming

intamap (version 1.3-27)

createIntamapObject: Create an object for interpolation within the intamap package

Description

This is a help function for creating an object (see intamap-package to be used for interpolation within the intamap-package

Usage

createIntamapObject(observations, obsChar, formulaString,
            predictionLocations=100, targetCRS, boundaries, boundaryLines,
            intCRS, params=list(), boundFile, lineFile, class="idw",
            outputWhat, blockWhat = "none",...)

Arguments

obsChar
list with observation characteristics, used by some interpolation methods
formulaString
formula that defines the dependent variable as a linear model of independent variables; suppose the dependent variable has name z, for ordinary and simple kriging use the formula z~1; for universal kriging, s
predictionLocations
either a Spatial* object with prediction locations or an integer with the requested number of prediction locations. If boundaries are supporte
targetCRS
the wanted projection for the interpolated map
boundaries
SpatialPolygonsDataFrame with the boundaries of regions in the prediction region
boundaryLines
SpatialPointsDataFrame with the boundaries between pairs of regions discretized as points. Will be read from file if
intCRS
a particular projection requested for the interpolation
params
parameters for the interpolation, given as exceptions to the default parameters set in the function getIntamapParams
boundFile
Filename where boundaries can be found, e.g. a shapefile
lineFile
Filename where paired points on boundaries can be found
class
setting the class(es) of the object, see intamap-package
outputWhat
List defining the requested type of output. Parameters: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] The list defaults to list (mean = TRUE) for objects of class IDW a
blockWhat
List defining particular output for block predictions. These include: [object Object],[object Object],[object Object],[object Object]
...
  • Either: other elements that can be used by particular interpolation methods. These are added to the object as named elements.
  • Or: elements that have been created in earlier calls to one of the functions in the

Value

  • An object with observations, prediction locations, parameters and possible additional elements for automatic interpolation. The object will have class equal to the value of argument class, and methods in the intamap-package will dispatch on the object according to this class.

Details

This function is a help function for creating an object (see intamap-package) for interpolation within the intamap-package. The function uses some default values if certain elements are not included.

If createIntamapObject is called without predictionLocations, or if a number is given, the function will sample a set of predictionLocations. These will be sampled from a regular grid.

targetCRS and intCRS are not mandatory variables, but are recommended if the user wants predictions of a certain projection. intCRS is not necessary if the targetCRS is given and has a projection (is not lat-long). It is recommended to include the argument intCRS if all projected elements are lat-long, as many of the interpolation methods do not work optimal with lat-long data.

The ...-argument can be used for arguments necessary for new methods not being a part of the intamap-package. It is also a method for reusing previously calculated elements that can be assumed to be unchanged for the second interpolation.

References

http://www.intamap.org/

See Also

intamap-package and getIntamapParams

Examples

Run this code
library(intamap)

# set up data:
data(meuse)
coordinates(meuse) = ~x+y
meuse$value = log(meuse$zinc)
data(meuse.grid)
gridded(meuse.grid) = ~x+y
proj4string(meuse) = CRS("+init=epsg:28992")
proj4string(meuse.grid) = CRS("+init=epsg:28992")

# set up intamap object:
idwObject = createIntamapObject(
	observations = meuse,
	predictionLocations = meuse.grid,
	targetCRS = "+init=epsg:3035",
	class = "idw"
)

Run the code above in your browser using DataLab