[R] graph for selected lines in stars()

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Thu Aug 7 13:49:57 CEST 2003


Tito de Morais Luis <Luis.Tito-de-Morais at ird.sn> writes:

> Dear listers,
> 
> The following command (derived from the example in the ?stars help page)
> works :
> 
> data(mtcars)
> stars(mtcars[, 1:7])
> 
> But the following gives an error:
> stars(mtcars[1, 1:7])
> Error in s.y[i, ] : incorrect number of dimensions
> 
> I was expecting to have the star graph for the first line (Mazda Rx4)

I don't think that makes sense. Star graphs are only defined for an
ensemble of rowss, at least with the default setting of 'scale=TRUE'.
 
> The following give an incorrect graph for the first two cars :
> stars(mtcars[1:2, 1:7])

Looks correct to me. 1st two models are identical on five variables,
and the remaining two are scaled to [0,1], which in this case means
that you get two zeros for the first car and two ones for the other.


> The following gives the correct graphs for all cars:
> stars(mtcars[1:32, 1:7])
> 
> How can I have correct graphs for a selection of lines ?

First define "correct". You can use scale=FALSE and do the scaling
yourself in some way that is independent of the subset chosen.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907




More information about the R-help mailing list