[R] Vector Join

Michael Dewey med at aghmed.fsnet.co.uk
Mon Aug 14 19:00:12 CEST 2006


At 13:23 13/08/2006, Michael Zatorsky wrote:
>Hi,
>
>I'm working on producing a simple cumulative frequency
>distribution.
>
>Thanks to the help of the good people on this list I
>now have four vectors that I'd like to join/relate
>into a table. e.g.
>
>
>v1 <- myHistogram$breaks             # classes
>v2 <- myHistogram$counts             # freqs
>v3 <- cumsum(v2)                     # cumulative freq
>v4 <- ((v3 / length(myData)) * 100)  # cumulative %

data.frame(v1 = myHistogram$breaks, v2 = myHistogram$counts, and so on ...)



>What is the recommend approach to turning these into a
>single table with four columns?  ie effectively doing
>a relational join on row id?
>
>The goal is to ultimately have the data with one row
>per class in a format I can write out to a text file
>as:
>
>   v1    v2    v3    v4
>   v1    v2    v3    v4
>   etc...
>
>Any advice will be appreciated.
>
>Regards
>Michael.
>
>
>
>
>
>____________________________________________________
>
>Coming soon: Celebrity Survivor - 11 celebrities, 25 days, unlimited drama

Michael Dewey
med at aghmed.fsnet.co.uk
http://www.aghmed.fsnet.co.uk/home.html



More information about the R-help mailing list