rtop (version 0.5-14)

createRtopObject: Create an object for interpolation within the rtop package

Description

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

Usage

createRtopObject(observations, predictionLocations,
   formulaString, params=list(), ainfo, areas, overlapObs,
   overlapPredObs, ...)

Value

An object of class rtop with observations, prediction locations, parameters and possible other elements useful for interpolation in the rtop-package. Most other externally visible functions in the package will be able to work with this object, and add the results as a new element.

Arguments

observations

SpatialPolygonsDataFrame with observations

predictionLocations

a SpatialPolygons or a SpatialPolygonsDataFrame-object with prediction locations

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, suppose z is linearly dependent on x and y, use the formula z~x+y. The formulaString defaults to "value~1" if value is a part of the data set. If not, the first column of the data set is used. Universal kriging is not yet properly implemented in the rtop-package, this element is mainly used for defining the dependent variable.

params

parameters to modify the default parameters of the rtop-package, set internally in this function by a call to getRtopParams

ainfo

SpatialPointsDataFrame with information about the observations. Only used here if it contains information for separating the observations into observations and predictionLocations or combining ainfo with areas to find observations and predictionLocations(depreceted method). The last could be from a call to readAreaInfo

areas

SpatialPolygonsDataFrame with areal information, typically from a call to readAreas. This argument is normally not used if the observations and predictionLocations are already given above.

overlapObs

matrix with observations that overlap each other

overlapPredObs

matrix with observations and predictionLocations that overlap each other

...

Extra parameters to getRtopParams and possibility to pass depreceted arguments

Author

Jon Olav Skoien

References

Skoien J. O., R. Merz, and G. Bloschl. Top-kriging - geostatistics on stream networks. Hydrology and Earth System Sciences, 10:277-287, 2006.

Skoien, J. O., Bloschl, G., Laaha, G., Pebesma, E., Parajka, J., Viglione, A., 2014. Rtop: An R package for interpolation of data with a variable spatial support, with an example from river networks. Computers & Geosciences, 67.

See Also

getRtopParams

Examples

Run this code
 ## Not run: 
library(rgdal)
rpath = system.file("extdata",package="rtop")
observations = readOGR(rpath,"observations")
# Create a column with the specific runoff:
observations$obs = observations$QSUMMER_OB/observations$AREASQKM
predictionLocations = readOGR(rpath,"predictionLocations")

# Setting some parameters 
params = list(gDist = TRUE, cloud = FALSE)
# Create a column with the specific runoff:
observations$obs = observations$QSUMMER_OB/observations$AREASQKM
# Build an object
rtopObj = createRtopObject(observations, predictionLocations, 
                           params = params)

## End(Not run)

Run the code above in your browser using DataCamp Workspace