View source: R/cluster_analysis_fun.R
| cluster_analysis_fun | R Documentation |
Internal worker functions used by the parallel clustering-analysis wrappers.
Each function executes one clustering trial, optionally assigns a deterministic
seed, records elapsed computation time, and extracts a result element named
Cls.
cluster_analysis_fun(
i,
fun,
DataOrDistances,
ClusterNo = NULL,
SetSeed = TRUE,
...
)
CA_data_fun(
i,
fun,
Data,
ClusterNo = NULL,
SetSeed = TRUE,
...
)
CA_dist_fun(
i,
fun,
Distances,
ClusterNo = NULL,
SetSeed = TRUE,
...
)
i |
Positive integer trial identifier. When |
fun |
Function or character string naming the clustering function. |
DataOrDistances |
Generic data, distance, or dissimilarity input passed to |
Data |
Dataset passed to a data-based clustering function. |
Distances |
Distance or dissimilarity input passed to a distance-based clustering function. |
ClusterNo |
Optional number of clusters. If |
SetSeed |
Logical scalar. If |
... |
Further arguments passed to the clustering function. |
The functions inspect the formal arguments of fun to determine the name
under which the main input is supplied.
cluster_analysis_fun() recognizes generic data and distance argument
names. CA_data_fun() prefers Data, and
CA_dist_fun() prefers names associated with distances or
dissimilarities.
Named arguments in ... may not duplicate arguments supplied by the
worker. If fun has no ... formal argument, unsupported named
arguments are removed before the call.
Only an exactly unique element named Cls is extracted. Otherwise,
Cls is returned as NULL.
A list with components:
Cls |
Clustering vector extracted from the result, or |
ComputationTime |
Named numeric scalar containing elapsed time in seconds. |
Seed |
Integer seed, or |
CAs |
Complete object returned by the clustering function. |
These are internal implementation functions. Users should normally call
parApplyClusterAnalysis,
parApplyDataBasedCA, or
parApplyDistanceBasedCA.
Michael Thrun
Thrun, M. C.: Distance-Based Clustering Challenges for Unbiased Benchmarking Studies, Nature Scientific Reports, Vol. 11, pp. 18988, DOI: 10.1038/s41598-021-98126-1, 2021.
parApplyClusterAnalysis
## Not run:
#data(Hepta)
#Distance=as.matrix(parallelDist::parallelDist(Hepta$Data))
#out=cluster_analysis_fun(i = 1,fun = APclusterin
#g,DataOrDistances = Distance,ClusterNo = 7)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.