cluster_elements() takes as imput a `tbl` formatted as | <element> | <feature> | <value> | <...> | and identify clusters in the data.
cluster_elements(
.data,
.element,
.feature,
.value,
method,
of_elements = TRUE,
transform = NULL,
action = "add",
...
)# S4 method for spec_tbl_df
cluster_elements(
.data,
.element,
.feature,
.value,
method,
of_elements = TRUE,
transform = NULL,
action = "add",
...
)
# S4 method for tbl_df
cluster_elements(
.data,
.element,
.feature,
.value,
method,
of_elements = TRUE,
transform = NULL,
action = "add",
...
)
A `tbl` formatted as | <element> | <feature> | <value> | <...> |
The name of the element column (normally elements).
The name of the feature column (normally features)
The name of the column including the numerical value the clustering is based on (normally feature value)
A character string. The cluster algorithm to use, ay the moment k-means is the only algorithm included.
A boolean. In case the input is a nanny object, it indicates Whether the element column will be element or feature column
A function to use to tranforma the data internalli (e.g., log1p)
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
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
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.
# NOT RUN {
cluster_elements(mtcars_tidy, car_model, feature, value, method="kmeans", centers = 2)
# }
Run the code above in your browser using DataLab