[R] using table function

Jim Lemon jim at bitwrit.com.au
Thu Jan 17 11:24:52 CET 2008


  Ricardo Perrone <perrone at rocketmail.com> wrote:
>

>Hi,
>
>How to join  two large vectors ordered, where one
>has the variable's levels and another has the
>frequencies, in way similar to that showing by table
>function in R console? and considering this two
>vectors how to use summary function to produce
>statistical informations like mean, sd, min, max and
>quartile?
>
>Thanks
>Ricardo
>
Hi Ricardo,
I'll guess that you mean two vectors like this:

V1	1	2	3	4	5

V2	10	21	32	45	5

cat(formatC(V1,width=8),"\n",formatC(V2,width=8),"\n",sep="")

Then you might want:

datavec<-rep(V1,V2)

and perform the summaries on that vector.

Jim




More information about the R-help mailing list