cluster2plot | R Documentation |
This function allows to prepare a grid of clusters (included in 'time' dimension) for plotting. A subset of a variable and/or member is also performed in multimember or multigrid objects.
cluster2plot(cluster, members = 1, var = getVarNames(cluster)[1])
cluster |
A grid (gridded or station dataset), multigrid, multimember grid or multimember multigrid object, as
returned by |
members |
(optional) Integer value indicating the position of the member to be subset. Default: 1. If input grid has no member dimension, this argument is ignored. |
var |
(optional) Character vector indicating the variable name to be extracted. Default: first variable. See subsetGrid. |
A new C4R grid object that contains the clusters from the specified variable and/or member.
This subset grid of clusters is ready to be plotted with C4R plotting tools, e.g. spatialPlot
, since clusters are intrepreted as variables (see makeMultiGrid).
J. A. Fernandez
makeMultiGrid, subsetGrid, subsetDimension.
require(climate4R.datasets)
#Example 1: 'cluster' is a 3D grid of clusters.
data(NCEP_Iberia_psl)
clusters<- clusterGrid(NCEP_Iberia_psl, type = "kmeans", centers = 10)
mg <- cluster2plot(clusters)
require(visualizeR)
spatialPlot(mg, backdrop.theme = "coastline", rev.colors = TRUE,
layout = c(2,ceiling(attr(clusters, "centers")/2)),
as.table = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.