1
Ich möchte ein nettes Diagramm erstellen, das einige meiner Daten veranschaulicht.So fügen Sie Text zu einem Diagramm in diagrameR
Ich habe das Diagramm erstellt, aber ich möchte etwas berechneten Text zum Knoten hinzufügen. Wie mache ich das.
Das ist mein Graph ist aber wie/wo füge ich ein Feld I in R berechnet haben ?:
library(magrittr)
library(DiagrammeR)
# Create a simple NDF
nodes <-
create_nodes(nodes = c("Index", "Surveillance", "Intervention", "Lost to Follow-up"))
# Create a simple EDF
edges <-
create_edges(from = c("Index", "Surveillance", "Index", "Surveillance","Intervention","Surveillance","Intervention"),
to = c("Surveillance", "Intervention", "Lost to Follow-up", "Lost to Follow-up","Intervention","Surveillance","Lost to Follow-up"),
)
graph <-
create_graph(
nodes_df = nodes,
edges_df = edges,
graph_attrs = "layout = twopi",
node_attrs = "fontname = Helvetica",
edge_attrs = "color = gray20"
)
# View the graph
render_graph(graph,output = "visNetwork")