That function, expand.dft is in the vcdExtra package
On 6/15/2016 12:42 PM, Marc Schwartz wrote:
There is a function called expand.dft(), which I posted some years ago, which
is a modification of a prior version, posted a few years before that.
The updated version is here:
https://stat.et
[3,] "b" "A"
> [4,] "b" "A"
> [5,] "c" "A"
> [6,] "d" "A"
>
> -----
> David L Carlson
> Department of Anthropology
> Texas A&M University
> College Station, TX 77
ot; "A"
[2,] "a" "A"
[3,] "b" "A"
[4,] "b" "A"
[5,] "c" "A"
[6,] "d" "A"
-
David L Carlson
Department of Anthropology
Texas A&M University
College St
> On Jun 15, 2016, at 11:10 AM, Patrizio Frederic
> wrote:
>
> Dear R-users,
> I've a problem that puzzle me
>
> suppose I have a two way contigency table
>
> a <- sample(al <- letters[1:10],100,T)
> b <- sample(bl <- LETTERS[1:5],100,T)
> ab <- cbind(a,b)
>
> ddd <- (xtabs(data = ab))
> dd
Em Qua 15 jun. 2016, às 13:10, Patrizio Frederic escreveu:
> Dear R-users,
> I've a problem that puzzle me
>
> suppose I have a two way contigency table
>
> a <- sample(al <- letters[1:10],100,T)
> b <- sample(bl <- LETTERS[1:5],100,T)
> ab <- cbind(a,b)
>
> ddd <- (xtabs(data = ab))
> ddd <- a
Hi Patrizio,
maybe there is a more efficient way, but you can loop over rows and columns
like this
ab.recon <- data.frame()
ddd.rownames <- rownames(ddd)
ddd.colnames <- colnames(ddd)
for(cur.row in ddd.rownames){
for(cur.col in ddd.colnames){
times.found <- ddd[cur.row, cur.col]
tmp.
Dear R-users,
I've a problem that puzzle me
suppose I have a two way contigency table
a <- sample(al <- letters[1:10],100,T)
b <- sample(bl <- LETTERS[1:5],100,T)
ab <- cbind(a,b)
ddd <- (xtabs(data = ab))
ddd <- as.matrix(ddd)
the question is: how do I reverse the code, thus how do I get raw
7 matches
Mail list logo