Cluster Analysis 'OpenBudgets.eu'

Estimate and return the needed parameters for visualisations designed for 'OpenBudgets' < http://openbudgets.eu/> data. Calculate cluster analysis measures in Budget data of municipalities across Europe, according to the 'OpenBudgets' data model. It involves a set of techniques and algorithms used to find and divide the data into groups of similar observations. Also, can be used generally to extract visualisation parameters convert them to 'JSON' format and use them as input in a different graphical interface.


Cluster.OBeu

Kleanthis Koupidis, Charalampos Bratsas, Jaroslav Kuchar November 9, 2016

Cluster.OBeu

Εstimate and return the necessary parameters for cluster analysis visualizations, used in OpenBudgets.eu. It involves a set of techniques and algorithms used to find and divide into groups the Budget data of municipalities across Europe, described by the OpenBudgets.eu data model.

The available clustering algorithms are hierarchical, kmeans from R base, pam, clara, fuzzy from cluster package and model based algorithms from mclust package. It can be used to find the appropriate clustering algorithm and/or the appropriate clustering number of the input data according to the internal and stability measures from clValid package.

This package can generally be used to estimate clustering parameters, extract and convert them to JSON format and use them as input in a different graphical interface and also can be used in data that are not described by the OpenBudgets.eu data model.

You can see detailed information here.

install.packages(Cluster.OBeu) 
# or
# alternatively install the development version from github
devtools::install_github("okgreece/Cluster.OBeu")

Load library Cluster.OBeu

library(Cluster.OBeu)

Cluster Analysis in a call

cl.analysis can be used to estimate clustering model parameters and/or number of clusters needed for visualization of clusters and other clustering measures as list object.

cluster_data = cl.analysis( city_data, cl.aggregate = "sum", 
                            cl.meth = "pam", clust.numb = NULL, dist = "euclidean", tojson = T) # json string format
 
jsonlite::prettify(cluster_data) # use prettify of jsonlite library to add indentation to the returned JSON string

Cluster Analysis on OpenBudgets.eu platform

open_spending.cl is designed to estimate and return the clustering model measures of OpenBudgets.eu datasets.

The input data must be a JSON link according to the OpenBudgets.eu data model. There are different parameters that a user could specify, e.g. dimensions, measured.dimensions and amounts should be defined by the user, to form the dimensions of the dataset. open_spending.cl estimates and returns the json data that are described with the OpenBudgets.eu data model, using cl.analysis function.

#Store the link in a variable
json_link='http://ws307.math.auth.gr/rudolf/public/api/3/cubes/budget-athens-revenue-2007__93458/aggregate?drilldown=budgetPhase.prefLabel%7CadministrativeClassification.prefLabel&aggregates=amount.sum'
 
clustering = open_spending.cl(
  json_data =  json_link, 
  dimensions ="administrativeClassification.prefLabel",
  measured.dimensions ="budgetPhase.prefLabel",
  amounts = "amount.sum",
  cl.method = "fanny",
  cl.num = 3
  )
# Pretty output using prettify of jsonlite library
jsonlite::prettify(clustering,indent = 2)

News

Cluster.OBeu 1.2.1

update manuals, vignettes and small fixes in functions

Cluster.OBeu 1.2.0

Add open_spending.cl function to be used in OpenBudgets.eu tools.

Cluster.OBeu 0.2.0

First stable version of the library.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("Cluster.OBeu")

1.2.2 by Kleanthis Koupidis, a month ago


https://github.com/okgreece/Cluster.OBeu


Report a bug at https://github.com/okgreece/Cluster.OBeu/issues


Browse source code at https://github.com/cran/Cluster.OBeu


Authors: Kleanthis Koupidis [aut, cre] , Charalampos Bratsas [aut] , Jaroslav Kuchar [ctb]


Documentation:   PDF Manual  


GPL-2 | file LICENSE license


Imports car, cluster, clValid, data.tree, dendextend, graphics, jsonlite, mclust, methods, RCurl, reshape, reshape2, stringr, utils

Suggests knitr, rmarkdown


See at CRAN