result.extract.sub: Extract values

View source: R/result.extract.sub.R

result.extract.subR Documentation

Extract values

Description

Extracts and transformates given values to a data.frame with same order as a given masking grid.

Usage

result.extract.sub(mask.grid, values, gk4.x, gk4.y, 
	outliers, silent=FALSE, withOutliers=FALSE)

Arguments

mask.grid

A grid containing spatial information related to the values and their Gauss-Krueger-Coordinates. The values in the resulting data.frame will be ordered related to values in ‘mask.grid’.

values

The values that should be extracted and transformed.

gk4.x

Gauss-Krueger-Rechtswert related to values.

gk4.y

Gauss-Krueger-Hochwert related to values.

outliers

Outlier information related to values.

silent

A boolean value determining wether the function should generate output messages or not.

withOutliers

A boolean value determining wether outliers should be included in extraction and transformation or not.

Details

Extracts and transformates given values (with related Gauss-Krueger-Coordinates) to a data.frame with same order as a given masking grid.

Value

A grid containing the values and their coordinates (as given in ‘mask.grid’).

Author(s)

Daniel Doktor, Maximilian Lange

See Also

result.extract.main

Examples

  ## load preprocessed data
  data(dataFinal)
  ## load spatial information
  data(relatedGrid)

  ## set or load params
  params <- c(0, 0.058326, 0.109494, 0.039178, 
			-10.34, -0.89, 18.11,-10.03, 
			28.61, 44.49)

  ## apply model
  result <- pim.solve(params, dataFinal, model.no=11, 
			silent=FALSE, out2File=FALSE)
 
  ## resolve outlier information
  outliers <- result$outlier.bb + result$outlier.lc
  outliers.na <- which(is.na(outliers)==TRUE)
  outliers[outliers.na] <- rep(0, length(outliers.na))

  mask.grid <- relatedGrid

  ## extract valid modelled values
  values.model <- result.extract.sub(mask.grid=mask.grid, 
				result$doy.bb.pim, result$gk4.x, 
				result$gk4.y, outliers=outliers, 
				silent=FALSE, withOutliers=FALSE)$values

phenmod documentation built on April 14, 2022, 5:08 p.m.