Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 205330

Making pie chart with top 5 values

$
0
0

I would like to know how do I put this "a" with top 5 values into my pie chart. I could not find it anywhere in the internet and sadly couldn't figure it out myself neither

a <- c(straty$Martwi.jako.procent.populacji.przedwojennej)
  tail(sort(a),5)

  output$wykres6 <- renderPlot({ #tak tworzysz wykresy w shiny podajesz funkcji informacje o wyrenderowanym plocie i zapisujesz je pod dana nazwa w output
    ggplot(straty,aes(x="", y=Martwi.jako.procent.populacji.przedwojennej, fill=Martwi.jako.procent.populacji.przedwojennej))+
      geom_col(fill= rainbow(33)) +
      geom_text(aes(label = paste(Panstwo, ": ", Martwi.jako.procent.populacji.przedwojennej)),
                position = position_stack(vjust = .5)) +
      coord_polar(theta = "y") +
      theme_void()
  })

Viewing all articles
Browse latest Browse all 205330

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>