db.compare {RGeoS} | R Documentation |
Calculate pointwise statistics between several variables in a Db
db.compare(db, fun = "mean", names = NA, ngrep=NA)
db |
The |
fun |
The code giving the operation that must be performed between the different variables at the same point:
|
names |
List of the names of the attributes to be compared |
ngrep |
Generic name for the attributes. If defined, it overwrites the 'names' argument |
The input DB where the result of the operation is added as a new variable called "fun"
data(Example_data.db) # Load the Documentation Points Db Example_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' Example_data.db <- db.compare(Example_data.db,fun="mean",names=c(4,5)) # Print the contents of the new variable # print(Example_data.db,name="z1",flag.print=TRUE) # Clean the data set # rm(Example_data.db)