View source: R/poset_from_dataframe.R
poset_from_dataframe | R Documentation |
This function generates a poset from an object x
of class data.frame
that lists by rows all the observations in a statistical population and by columns the values of different orderable variables (i.e. vectors of class ordered
or numeric
).
poset_from_dataframe(x, collapse = "-")
x |
an object of class |
collapse |
an object of class |
The poset is generated through the component-wise comparability relation \insertCitedavey2002introductionPOSetR. Note that some observations may have the same profile (i.e. the same values for all the variables) therefore they have to be included into the same element of the poset, than the label of such element correspond to the labels of the statistical units separated by the collapse
character.
an S4 object of class Rcpp_POSet
; this class contains different C++ methods used by other functions of the package.
davey2002introductionPOSetR
poset
.
set <- ordered(letters[1:5])
set.seed(0)
n <- 30
x <- data.frame(
A = sample(set, n, replace = TRUE),
B = sample(set, n, replace = TRUE),
C = sample(set, n, replace = TRUE)
)
p <- poset_from_dataframe(x, collapse = ",")
plot(p, equispaced = TRUE, vertex.frame.color = "lightgray", vertex.color = "lightgray")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.