Not exactly clear what you are asking for. Your data.frame.table does not
seem related to the original 'orig'. What exactly are you expecting as
output?
On Wed, May 21, 2008 at 10:16 PM, maiya [EMAIL PROTECTED] wrote:
i appologise for the trivialness of this post - but i've been searching
sorry, my mistake!
the data frame should read:
orig-as.data.frame.table(orig)
orig
Var1 Var2 Freq
1AA 40
2BA5
3AB 30
4BB 25
but basicaly i would simply like a sample of the original matrix ( which is
a frequency table/contingency table/crosstabulation)
On May 22, 2008, at 8:56 AM, maiya wrote:
sorry, my mistake!
the data frame should read:
orig-as.data.frame.table(orig)
orig
Var1 Var2 Freq
1AA 40
2BA5
3AB 30
4BB 25
but basicaly i would simply like a sample of the original matrix
( which is
a
Is this what you want?
xtabs(Freq ~ Var1 + Var2, data = orig)
Var2
Var1 A B
A 40 30
B 5 25
See ?xtabs
Or is this what you want?
expand.dft - function(x, na.strings = NA, as.is = FALSE, dec = .)
{
DF - sapply(1:nrow(x), function(i) x[rep(i, each = x$Freq[i]), ],
4 matches
Mail list logo