groupBycoord {CAinterprTools} | R Documentation |
Define groups of categories on the basis of a selected partition into k groups employing the Jenks' natural break method on the selected dimension's coordinates
Description
The function allows to group the row/column categories into k user-defined partitions.
Usage
groupBycoord(data, x = 1, k = 3, which = "rows", cex.labls = 0.75)
Arguments
data |
Name of the dataset (must be in dataframe format). |
x |
Dimension whose coordinates are used to build the partitions. |
k |
Number of groups. |
which |
Speficy if rows ("rows"; default) or columns ("cols") must be grouped. |
cex.labls |
Set the size of the labels of the dot chart (0.75 by default). |
Details
K groups are created employing the Jenks' natural break method applied on the selected dimension's coordinates. A dot chart is returned representing the categories grouped into the selected partitions. At the bottom of the chart, the Goodness of Fit statistic is also reported. The function also returns a dataframe storing the categories' coordinates on the selected dimension and the group each category belongs to.
See Also
Examples
data(greenacre_data)
#divide the row categories into 3 groups on the basis of the coordinates
#of the 1st dimension, and store the result into a 'res' object
res <- groupBycoord(greenacre_data, x=1, k=3, which="rows")