Does this help?
a <- c(1,1,1,1,1,2,2,2,2,2)
b <- c(4,5,6,5,4,7,8,9,8,7)
c <- c("a","b","c","d","a","b","b","a","d","d")
A <- cbind(a,b,c)
test <- ftable(a,b,c)
test.df <- data.frame(test)
test.df[test.df$Freq != 0, ]
Doesn't quite give the layout you seem to want, but effectively removes the
ze
7 0 1 0 1
> 8 0 1 0 1
> 9 1 0 0 0
best regards
marc
> -Ursprüngliche Nachricht-
> Von: "Henrique Dallazuanna" <[EMAIL PROTECTED]>
> Gesendet: 02.09.08 18:33:53
> An: "Marc Flockerzi" <[EMAIL PROTECTED]>
> CC: r-help@r-project.org
Try this:
test[test == 0] <- ''
test
On Tue, Sep 2, 2008 at 1:03 PM, Marc Flockerzi <[EMAIL PROTECTED]>wrote:
> dear all,
>
> i'm just about to do some straightforward contingency tables using ftables
> (and ctab() for percents).
>
> the problem:
> factor "a" are regions, factor "b" are subregio
dear all,
i'm just about to do some straightforward contingency tables using ftables (and
ctab() for percents).
the problem:
factor "a" are regions, factor "b" are subregions.
every region "a" consists of some subregions "b", but obviously not every
subregion "b" is part of every region "a".
i
4 matches
Mail list logo