groceries.Rmd
Apply limits to width and thickness scales. Drop any sets that do not have links after limits are applied.
data("groceries")
# Define set names
setNames <- groceries %>%
select(-id) %>%
colnames()
# Define ID column
idName <- "id"
# Calculate set sizes
setSizes <-
getSetSizes(groceries, setNames)
# Calculate set sizes by degree
setSizesByDegree <-
getSetSizesByDegree(groceries, setNames, idName, maxDegree = 10)
# Calculate edge data
setIntersections <-
getSetIntersections(groceries, setNames, idName)
# Optimize link order
optOrder <- optimizeLinkOrder(setSizes,
setSizesByDegree,
setIntersections,
linkThickness = "prop")
buildRadialSetsPlot(
setSizes,
setSizesByDegree,
setIntersections,
linkThickness = "prop",
linkColor = "prop.relError",
linkColorPal = "YlOrRd",
reverseLinkPal = F,
colorScaleLim = c(0.5,1),
colorScaleMapFun = "censor",
edgeScaleLim = c(0.05,1),
edgeScaleMapFun = "censor",
sectorColor = "white",
sectorLabelFontSize = 0.5,
setOrder = optOrder,
dropSets = T
)