Excel export

Asked

Viewed 38 times

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) 
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.