[rkward-devel] Fwd: [rkward-users] Proposition of changes on crosstabulation plugin

Andrés Necochea yayopoint at gmail.com
Fri Apr 1 21:19:42 UTC 2011


I still working in the mod of crosstabulation plugin.

I have checked the function proposed by thomas, and I is ready for the use,
it can bind contingency tables with its statistic with more than two
dimensions. I don't want to be pompous, but I think that a function like
this should be part of the base packages in R ;)

I, don't make significative changes. I add the arguments row.vars and
col.vars, thats are pased to ftable function.
beside if you don't indicate the row.vars argument, it take the last level
in the table for the column. I also think that the user could decide if he
or she wants the statistics in rows or in colums

bind.tables <- function (row.vars=NULL, col.vars=NULL, ...) {
tables <- list (...)
output <- unlist (tables)
 dim (output) <- c (dim (tables[[1]]), length (tables))
dimnames (output) <- c (dimnames (tables[[1]]), list
(statistic=names(tables)))
 if (is.null(col.vars))
col.vars <- length(dim(tables[[1]]))
ftable (output, row.vars=row.vars, col.vars=col.vars)
}

I attached the plugin as a simple tar.gz file, I will read the manual for
make plugins to make a better plugin.

At now it can calculate the percents, and add sums at margins, I think that
it could calculate the cumsum, but I don't know how to put cumsum with
addmargins function.

I hope that you like this mod of crosstabulation plugin.

-- 
Amor y Paz
 _    _
 \\  //
_ \\//
\\   ^^>
 \____/

CHAU
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20110401/f4033e7b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: crosstab1.tar.gz
Type: application/x-gzip
Size: 2992 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20110401/f4033e7b/attachment.gz>


More information about the Rkward-devel mailing list