2

I am struggling a bit trying to do star plots in R.

I am currently generating the following star plot from this data frame:

   COMPACTNESS ELONGATEDNESS RADIUS_RATIO SCALED_VARIANCE
16          96           201           32             227
20         101           215           32             227
33          93           154           46             162
34         101           222           32             232
35          87           177           40             186
41          95           214           32             227
53          98           228           31             236
59         107           221           32             222
61         103           212           34             214
62          77           135           52             145

Star Plots

The code used to generate it is:

stars(opel, main="Opel", key.labels=names(opel), scale = F,key.loc=c(4.5,12), cex=0.7, xpd=T)

This seems wrong to me. For example, the ratio in #16 between RADIUS_RATIO and everything else seems wrong. Also, 62 is only a straight line.

What do I need to change in the star plot generation?

G5W
  • 36,531
  • 10
  • 47
  • 80
Pythoner
  • 69
  • 4

1 Answers1

0

It looks like the plot is correct. Though you used scale = T (otherwise outcome would have been completely different). With that scale = T, the columns of the data matrix are scaled independently so that the maximum value in each column is 1 and the minimum is 0. And for example with 62, both COMPACTNESS and RADIUS_RATIO were the minimal values of the whole variable, so they both were scaled to 0. And when you draw a 4-point star with opposing corners scaled to 0, you get a straight line.

You can set scale = F but then you´ll need to scale the data with some other algorithm to the [0,1] according to documentation.

Oka
  • 1,318
  • 6
  • 11