Description Usage Arguments Details Value Author(s) Examples
For repeated measurements on the same ID, build unique cluster labels according to the vector of IDs.
1 |
id |
Vector of IDs. |
clusters |
Vector of cluster labels. |
reduce |
|
Data might have been stored in 4 columns: curveID, curve evaluations,
time points and cluster labels. Cluster labels were therefore repeated
for each curve evaluation point. Method funcit
accepts
dataset only in formats "Format1" and "Format2" and an optional vector
of cluster true labels clusters
of length nr_curves. getUniCl
can be
applied to columns curveID and repeated labels to reduce them
to the number of curves.
A vector of either reduced (reduce
=TRUE
) or duplicated (reduce
=FALSE
) cluster labels.
Christina Yassouridis
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ##Generate dataset
nr_time <- sample(1:5, 100, replace=TRUE)
clusters <- sample(1:4, 100, replace=TRUE)
IDs <- rep(1:100, nr_time)
cls <- rep(clusters,nr_time)
IDs
cls
##Get reduced cluster vector according to IDs
unicl <- getUniCl(IDs,cls)
unicl
##Get original cluster vector from reduced one
dupcl <- getUniCl(IDs,unicl, reduce=FALSE)
dupcl
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.