How to reshape my dataset to use a

Dear Braintrust,
I'm not used with igraph and ggraph package but very interested in the graphical output for displaying hierarchical data.
I try to make a circle packing plot using the packages ggraph and igraph following the example from R-graph gallery https://www.r-graph-gallery.com/314-custom-circle-packing-with-several-levels.html but I am little embarassed with some coding issue

my dataset consist in different clinical signs (variable "clin") which present a certain number of time ("nombre"). These signs are nested in 3 larger categories of signs ("group") in a dataframe "donnees_signes".

group <- c(rep("General signs", 6), rep("Respiratory signs", 6), rep("Other signs", 3))
clin <- c("Depression", "Anorexia", "Pyrexia", "Milk drop", "Weight loss", "Recumb.",
         "Nasal discharge", "Cough","Increased respiratory rate", "Dyspnea", "Open mouth breathing", "Ocular discharge",
         "Diarrhea", "Salivation", "Emphysema")
nombre <- c(6,8,19,4,1,1,18,17,10,16,2,8,3,1,2)

donnees_signes <- cbind(group, clin, nombre)
donnees_signes <- as.data.frame(donnees_signes)

I then want to create a circle packing graph with larger circles representing the "group" where "clin" signs circles are within their appropriate group and size are proportional to the number of signs (nombre).

I see that the type data read by graph_from_data_frame() need to contain vertices and edge but I'm not sure I really understand from the website a clear explanation of what it is and how to reshape my dataset to be able to make this type of graph.
any help would be greatly appreciated on how to make it more properly and/or on sites to learn more about this type of dataframe.

many thanks

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.