0
It needed to export some elements of R: distribution tables, Plots, etc to excel in order to "fill" predefined and formatted spaces (namely as regards colors, font etc.) in excel. How can I do?
Example:
df <- data.frame(
origem = c("A", "A", "A", "B", "C", "F", "D", "C"),
destino = c("B", "C", "D", "E", "F", "G", "H", "G"),
valor = c(3, 4, 2, 1, 5, 2, 7, 6))
# exemplo de plot
grafo1 <- graph.edgelist(as.matrix(df[1:2]))
plot(grafo1,
#vertex.label=valor,
vertex.size=20,
edge.width=5,
layout=layout_as_star(grafo1),
main="Grafo 1")
# exemplo de table
novo_df <- df %>% group_by(origem) %>%
summarise(Total_ocorrencias = n()) %>%
mutate(Freq_perc = (Total_ocorrencias / sum(Total_ocorrencias))*100)
The xlsx package does what it needs, but requires a lot of coding. I recommend this STHDA guide (in English) for a quick introduction.
– Carlos Eduardo Lagosta