LVIclust: Local variables importance (LVI) clustering from GWRFC...

View source: R/LVIclus.R

LVIclustR Documentation

Local variables importance (LVI) clustering from GWRFC outputs

Description

This function clusters local variables importance (LVI) output with different methods, including: Gaussian Mixture Modelling (mclust), Kohonen's Self-Organizing Maps (kohonen), or hierarchical clustering (hclust)

Usage

LVIclust(
  input_LVI,
  remove_columns = NA,
  method_clustering = "ward.D2",
  ncluster = 2,
  plots = T,
  output_folder
)

Arguments

input_LVI

string or Spatial-class. Input shapefile of GWRFC LVI output. It can be the filename of the shapefile or an object of class SpatialPolygonsDataFrame or SpatialPointsDataFrame.

remove_columns

string. Remove specific variables from input_LVI. Variables are identified by column name. NA ignores column remove. By default, column "ID_row" is removed.

method_clustering

string. A method to use for clustering. It can be:"ward.D","ward.D2","single","complete","average","mcquitty","median", "centroid", "mclust" or "SOM". The latter, is calculated with the kohonen library.

ncluster

numeric. Number of clusters to apply. Should be more than 2.

plots

logical. If TRUE, plots from clustering libraries are generated and stored at output_folder (except for mclust).

output_folder

string. Output folder where LVIclust outputs will be stored.

Value

The output of this function is a shapefile with the resulting clusters and its plot if it was specified.

Examples


#based in the example showed with the execution of GWRFC

LVIclust(input_LVI = "E:/demo/deforestation/GWRFC_ADP_400_EX_LVI.shp", #filename of the GWRFC LVI output
remove_columns=NA,
method_clustering="mclust", #hierarchical clustering is applied here.
ncluster = 2, #number of clusters.
plots=T, #available only for all hierarchical clustering methods and kohonen.
output_folder = "E:/demo/deforestation") #check this folder for outputs generated by the function.


FSantosCodes/GWRFC documentation built on Sept. 24, 2023, 6:07 a.m.