Learn R Programming

lgcp (version 1.8)

guessinterp: guessinterp function

Description

A function to guess provisional interpolational methods to variables in a data frame. Numeric variables are assigned interpolation by areal weighted mean (see below); factor, character and other types of variable are assigned interpolation by majority vote (see below). Not that the interpolation type ArealWeightedSum is not assigned automatically.

Usage

guessinterp(df)

Arguments

df

a data frame

Value

the data frame, but with attributes describing the interpolation method for each variable

Details

The three types of interpolation method employed in the package lgcp are:

  1. 'Majority' The interpolated value corresponds to the value of the covariate occupying the largest area of the computational cell.

  2. 'ArealWeightedMean' The interpolated value corresponds to the mean of all covariate values contributing to the computational cell weighted by their respective areas.

  3. 'ArealWeightedSum' The interpolated value is the sum of all contributing covariates weighed by the proportion of area with respect to the covariate polygons. For example, suppose region A has the same area as a computational grid cell and has 500 inhabitants. If that region occupies half of a computational grid cell, then this interpolation type assigns 250 inhabitants from A to the computational grid cell.

See Also

chooseCellwidth, getpolyol, getZmat, addTemporalCovariates, lgcpPrior, lgcpInits, CovFunction lgcpPredictSpatialPlusPars, lgcpPredictAggregateSpatialPlusPars, lgcpPredictSpatioTemporalPlusPars, lgcpPredictMultitypeSpatialPlusPars

Examples

Run this code
# NOT RUN {
spdf a SpatialPolygonsDataFrame
# }
# NOT RUN {
spdf@data <- guessinterp(spdf@data)
# }

Run the code above in your browser using DataLab