View source: R/select_components.R
select_components | R Documentation |
Subset a btdata object by selecting components from it.
select_components(btdata, subset, return_graph = FALSE)
btdata |
An object of class "btdata", typically the result ob of ob <- btdata(..). See |
subset |
A condition for selecting a subset of the components. This can either be a character vector of names of the components, a single predicate function (that takes a component as its argument), or a logical vector of the same length as the number of components). |
return_graph |
Logical. If TRUE, an igraph object representing the comparison graph of the selected components will be returned. |
A btdata
object, which is a list containing:
wins |
A square matrix, where the i,j-th element is the number of times item i has beaten item j. |
components |
A list of the fully-connected components. The names of the list preserve the names of the original |
graph |
The comparison graph of the selected components (if return_graph = TRUE). |
Ella Kaye
btdata
, btfit
toy_df_4col <- codes_to_counts(BradleyTerryScalable::toy_data, c("W1", "W2", "D")) toy_btdata <- btdata(toy_df_4col) ## The following all return the same component select_components(toy_btdata, "3", return_graph = TRUE) select_components(toy_btdata, function(x) length(x) == 4) select_components(toy_btdata, function(x) "Cyd" %in% x) select_components(toy_btdata, c(FALSE, FALSE, TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.