Re: [R] Frequencies into Poisson responses

2006-05-18 Thread Prof Brian Ripley
In fact you have an ftable, not a multi-way table, but as.data.frame works for multi-way tables, and here as.data.frame(as.table(ftabc)) works: as.data.frame(as.table(ftabc)) A B CC Freq 1 1 1 1 20 2 2 1 1 38 3 3 1 1 20 4 1 2 1 22 5 2 2 1 25 6 3 2 1 23 ... It would

Re: [R] Frequencies into Poisson responses

2006-05-18 Thread Murray Jorgensen
Actually I had just meant that because I had some factors I had a conceptual table. Using ftable() was just my way of getting the factors into data frame form. But thank you for showing me that as.data.frame() does exactly what I want. Murray Jorgensen Prof Brian Ripley wrote: In fact you

[R] Frequencies into Poisson responses

2006-05-17 Thread Murray Jorgensen
Suppose that one has several factors, all of the same length. These define a multi-way contingency table. Now suppose one wants to fit a Poisson GLM a.k.a. log-linear model to the frequencies in this table. How may we make the table into a data frame suitable for glm() ? I have an answer to my

[R] frequencies

2004-06-21 Thread Silvia Kirkman
Hi I have a set of fish lengths (cm) which I'd like to have divided into bins as specified by myself. I want to classify my bins as: 0=x0.5 0.5=x1 1=x1.5 1.5=x2 and so on... I'd like the frequencies to be given as a vector because I need to use these values for further analysis. Please can

RE: [R] frequencies

2004-06-21 Thread Wayne Jones
See ?hist For example hist(rnorm(100),plot=F,breaks=-3:3)$counts Regards Wayne -Original Message- From: Silvia Kirkman [mailto:[EMAIL PROTECTED] Sent: 21 June 2004 14:01 To: [EMAIL PROTECTED] Subject: [R] frequencies Hi I have a set of fish lengths (cm) which I'd like to have

RE: [R] frequencies

2004-06-21 Thread BXC (Bendix Carstensen)
-- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Silvia Kirkman Sent: Monday, June 21, 2004 4:01 PM To: [EMAIL PROTECTED] Subject: [R] frequencies Hi I have a set of fish lengths (cm) which I'd like to have divided

Re: [R] frequencies

2004-06-21 Thread Petr Pikal
On 21 Jun 2004 at 6:01, Silvia Kirkman wrote: Hi I have a set of fish lengths (cm) which I'd like to have divided into bins as specified by myself. I want to classify my bins as: 0=x0.5 0.5=x1 1=x1.5 1.5=x2 and so on... Hallo ?cut and ?table should be what you are looking for

Re: [R] frequencies

2004-06-21 Thread Adaikalavan Ramasamy
See the example in help(cut). You will require the option right=FALSE in cut() or you can try hist. x - abs(rnorm(100)) table( cut(x, seq(0, max(ceiling(x)), by=0.5), right=FALSE )) hist(x, breaks=seq(0, max(ceiling(x)), by=0.5), plot=FALSE) On Mon, 2004-06-21 at 14:01, Silvia Kirkman wrote: