Skip to content
Prev 277300 / 398506 Next

Running totals

Glad it worked!  The one "gotcha" is that it does not handle missing
values, so for example:
[1]  1  3  6 NA NA

both the NA, and everything after it become NA (missing).  If you find
yourself working with tables and frequencies and the like, you may
also like (if you have not already seen):

?table # tabulate data ?function pulls up documentation
## example
jane john
   3    1

?xtabs # cross tabulation
## examples using the built in mtcars dataset
## (vs and am are 0/1 data)
am
vs   0  1
  0 12  6
  1  7  7

You may also like the vcd (visualizing categorical data) package by
Michael Friendly:

Keeping with the mtcars data, we might want to visualize that little cross tab:

require(vcd)
pairs(xtabs(~ vs + am, data = mtcars))

Cheers,

Josh
On Mon, Nov 14, 2011 at 1:30 AM, Mark Carter <mcturra2000 at yahoo.co.uk> wrote: