db.compare {RGeostats}R Documentation

Pointwise statistics

Description

Calculate pointwise statistics between several variables in a Db

Usage

db.compare(db, fun = "mean", names = db.getname(db,"z",1))

Arguments

db

The db-class structure where the variables are stored

fun

The code giving the operation that must be performed between the different variables at the same point:

  • "num" : Number of valid samples

  • "mean" : Mean over the valid samples

  • "var" : Variance over the valid samples

  • "stdv" : Standard deviation over the valid samples

  • "mini" : Minimum over the valid samples

  • "maxi" : Maximum over the valid samples

  • "sum" : Sum over the different variables for the valid samples

names

List of names of attributes to be treated. For more information see db.ident.

Value

The input DB where the result of the operation is added as a new variable called "fun"

See Also

db-class

Examples

data(Z_data.db) # Load the Documentation Points Db
Z_data.db # Print a short contents of the Db

# Calculate the new variable 'mean' 
# which is obtained as the average 
# between variables 'z1' and 'z2'. 
# The new variable is now the locator 'z1'
Z_data.db <- db.compare(Z_data.db,fun="mean",names=c(4,5))

# Print the contents of the new variable #
print(Z_data.db,name="z1",flag.print=TRUE)

# Clean the data set #
rm(Z_data.db)

[Package RGeostats version 11.0.6 Index]