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

how to draw a radar chart with a lot of rows (or dimensions) using R?

$
0
0

Let's say I have such data:

a <- tibble(id=c(1,1.1,1.2,1.7,2,2.1,2.6,4,4.6,4.68),
            x=c(0.3,0.5,0.2,0.7,0.1,0.5,0.43,0.6,0.3,0.65),
            y=c(0.2,0.1,0.22,0.1,0.5,0.2,0.3,0.2,0.14,0.3))

This is just a sample, my real data is much more than this. and x+y+... = 1. I want to draw two lines: one line is for x, one line is for x+y:

ggplot(a) +
  geom_line(aes(x=id,y=x),color='red') +
  geom_line(aes(x=id,y=x+y),color='blue')

But what I really want it sth like a radar chart like:

enter image description here

You can see there is a circle with the radius to be 1. x and x+y, (maybe more in my data) are red and blue circles respectively. So, x+y must be larger than x but always in the circle because x+y+...=1. My data has a lot of ids, so it is not the traditional radar with few dimensions.

So, could anyone please help me out here?


Viewing all articles
Browse latest Browse all 206278

Trending Articles



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