[R] Matrix Results

Petr PIKAL petr.pikal at precheza.cz
Tue Mar 13 12:41:37 CET 2012


Hi

> 
> Hello
> 
>    I am developing a small program that to calculate the maximum, 
minimum
> and average.
> 
>     The data.frame v is 
> 
> POS       DIF
> 4 - 4       56
> 4 - 3       61
> 3 - 3       300
> 3 - 3        27
> 3 - 3       33
> 3 - 3       87
> 3 - 4      49
> 4 - 4      71
> 4 - 3     121
> 3 - 4     138
> 4 - 3      15
> 
> 
> When execute  res<-table(df$v) gives this
> Â 
> Var1    Freq
> 4 - 4      2
> 4 - 3      3
> 3 - 3     3
> 3 - 4     2
> 4 - 4    1
> 
> If possible, my idea is that the result often present in addition to the
> minimum, maximum and average, all in a single array, for example.
>    what is the quickest way to do this
> 
> Var1    Freq  Min    Max Med
> 4 - 4      2      56         71  ....
> 4 - 3      3      15       121
> 3 - 3     3      ....        .....
> 3 - 4     2     ...            ...
> 4 - 4    1    ...             ....

?aggregate

Regards
Petr


> 
> Thanks
> 
> 
> 
> --
> View this message in context: http://r.789695.n4.nabble.com/Matrix-
> Results-tp4468642p4468642.html
> Sent from the R help mailing list archive at Nabble.com.
>    [[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list