plot_spec: Plot results of the improved Fuzzy Cluster Method (FCMm)

Description Usage Arguments Value References Examples

Description

Spectra plots for a FCM.new result

Usage

1
2
3
4
5
6
7
plot_spec(
  res,
  show.stand = NULL,
  show.ribbon = FALSE,
  color_palette = RdYlBu(res$K),
  prefix = "Cluster "
)

Arguments

res

The result of function FCM.new

show.stand

Whether to show the spectra on standarized scale (default as NULL and assigned by res$FD$stand).

show.ribbon

Whether to show the ribbon defined by sd values calculated from samples in each cluster (default as FALSE).

color_palette

The palette of cluster color. Default as RdYlBu(res$K). In FCMm, it could be RdYlBu, Spectral, HUE or other color values with same length of cluster number.

prefix

Prefix of cluster name, default as "Cluster "

Value

The result of plot_spec is a list including:

References

Bi S, Li Y, Xu J, et al. Optical classification of inland waters based on an improved Fuzzy C-Means method[J]. Optics Express, 2019, 27(24): 34838-34856.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(FCMm) 
library(ggplot2) 
library(magrittr)
data("Nechad2015")
x <- Nechad2015[,3:11]
wv <- gsub("X","",names(x)) %>% as.numeric
w <- sample(1:nrow(x), 100)
x <- x[w, ]
names(x) <- wv
nb = 4 # Obtained from the vignette "Cluster a new dataset by FCMm"
FD <- FuzzifierDetermination(x, wv, stand=FALSE)
result <- FCM.new(FD, nb, fast.mode = TRUE)
p.spec <- plot_spec(result, show.stand = TRUE)
print(p.spec$p.cluster.spec)

bishun945/FCMm documentation built on Oct. 15, 2021, 6:43 p.m.