cgi {RGeoS} | R Documentation |
Calculate the Center of Gravity and the Inertia
cgi(db, name = NA, flag.plot=TRUE, flag.ellipse=TRUE, col=1, density=0, ...)
db |
Name of the |
name |
Name of the variable used for calculating the gravity center and the inertia. If not defined, the sample coordinates are used only |
flag.plot |
When TRUE, the gravity center and the inertia are represented graphically |
flag.ellipse |
When TRUE, the inertia ellipse is represented |
col |
Color used for representing the gravity center and the inertia (used when flag.plot=TRUE) |
density |
Density of the shadin lines (see polygon) |
... |
Additional parameters passed to the function polygon() |
The Center of Gravity and Inertia are calculated from the data location. If the argument 'name' is specified, the calculations take it into account. Finally a weight can be attached to each datum (if a variable is assigned to the locator "w").
A list which contains the following information:
* inertia : Value of the inertia
* weight : Total weight
* center : Coordinates of the center of gravity
* mvalue : Vector of Eigen values
* mvector : Matrix of the Eigen vectors