observations: SpatialPolygonsDataFrame or sf-polygons with observations
predictionLocations: a SpatialPolygons, SpatialPolygonsDataFrame-object or sf-polygons 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
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
Returns
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.
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.
Author(s)
Jon Olav Skoien
Examples
rpath = system.file("extdata",package="rtop")library(sf)observations = st_read(rpath,"observations")predictionLocations = st_read(rpath,"predictionLocations")# Create a column with the specific runoff:observations$obs = observations$QSUMMER_OB/observations$AREASQKM
# 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 objectrtopObj = createRtopObject(observations, predictionLocations, params = params)