On Friday 01 April 2011, Andrés Necochea wrote: > I, don't make significative changes. I add the arguments row.vars and > col.vars, thats are pased to ftable function.
Makes sense. On the other hand, thinking about it, I guess the conversion to ftable() does not belong into the bind.tables() function at all. It's merely something to format the table for printing. So, instead, I think the basic pattern should be output[[i]] <- bind.tables ("counts"=..., "% or row"=...) rk.print (ftable (output[[i]], col.vars=2)) > At now it can calculate the percents, and add sums at margins, I think you can simplify the addition of margins by using the "margin"- parameter of addmargins. Then you would not need to add margins to each statistic, separately, but rather addmargins (output[[i]], margin=1:2) (untested). Also, the rounding can probably be done for the whole table at once, rather than separately for each statistic. With that, probably you can also do away with "tables.row", "tables.column", etc. Rather use something like echo ('output[[i]] <- bind.tables ("counts"=results[[i]]'); if (getValue ("row") == "TRUE") echo (',\n "% of row"= prop.table(results[[i]], 1) * 100'); [...] echo (')'); > I think that > it could calculate the cumsum, but I don't know how to put cumsum with > addmargins function. Good question. Regards Thomas
signature.asc
Description: This is a digitally signed message part.
------------------------------------------------------------------------------ Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________ RKWard-devel mailing list RKWard-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rkward-devel