cluster_elements-methods: Get clusters of elements (e.g., elements or features)

Description Usage Arguments Details Value Examples

Description

cluster_elements() takes as imput a 'tbl' formatted as | <element> | <feature> | <value> | <...> | and identify clusters in the data.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
cluster_elements(
  .data,
  .element,
  .feature,
  .value,
  method,
  of_elements = TRUE,
  transform = NULL,
  action = "add",
  ...
)

## S4 method for signature 'spec_tbl_df'
cluster_elements(
  .data,
  .element,
  .feature,
  .value,
  method,
  of_elements = TRUE,
  transform = NULL,
  action = "add",
  ...
)

## S4 method for signature 'tbl_df'
cluster_elements(
  .data,
  .element,
  .feature,
  .value,
  method,
  of_elements = TRUE,
  transform = NULL,
  action = "add",
  ...
)

Arguments

.data

A 'tbl' formatted as | <element> | <feature> | <value> | <...> |

.element

The name of the element column (normally elements).

.feature

The name of the feature column (normally features)

.value

The name of the column including the numerical value the clustering is based on (normally feature value)

method

A character string. The cluster algorithm to use, ay the moment k-means is the only algorithm included.

of_elements

A boolean. In case the input is a nanny object, it indicates Whether the element column will be element or feature column

transform

A function to use to tranforma the data internalli (e.g., log1p)

action

A character string. Whether to join the new information to the input tbl (add), or just get the non-redundant tbl with the new information (get).

...

Further parameters passed to the function kmeans

Details

\lifecycle

maturing

identifies clusters in the data, normally of elements. This function returns a tibble with additional columns for the cluster annotation. At the moment only k-means clustering is supported, the plan is to introduce more clustering methods.

Value

A tbl object with additional columns with cluster labels

A tbl object with additional columns with cluster labels

A tbl object with additional columns with cluster labels

Examples

1
   cluster_elements(mtcars_tidy, car_model, feature, value, method="kmeans",	centers = 2)

nanny documentation built on July 1, 2020, 10:20 p.m.