Re: [R] Creating contingency table from mixed data

2007-05-06 Thread Ted Harding
On 05-May-07 23:14:38, spime wrote: Hi, I am new in R. Please help me in the following case. I have data in hand: http://www.nabble.com/file/8225/Data.txt Data.txt There are some categorical (binary and nominal) and continuous variables. How can i get a generic RXC contingency

[R] Creating contingency table from mixed data

2007-05-05 Thread spime
Hi, I am new in R. Please help me in the following case. I have data in hand: http://www.nabble.com/file/8225/Data.txt Data.txt There are some categorical (binary and nominal) and continuous variables. How can i get a generic RXC contingency table from this table? My main objective is to

[R] Creating a table

2006-11-14 Thread Michael Graber
Dear R List, I am a new to R, so my question may be easy to answer for you: I have a dataframe, for example: df-data.frame(loc=c(A,B,A,A,A), year=as.numeric(c(1970,1970,1970,1976,1980))) and I want to create the following table without using loops: 1970-74 ; 1975-79 ; 1980-85; rowsum

Re: [R] Creating a table

2006-11-14 Thread David Barron
addmargins(table(df)) On 14/11/06, Michael Graber [EMAIL PROTECTED] wrote: Dear R List, I am a new to R, so my question may be easy to answer for you: I have a dataframe, for example: df-data.frame(loc=c(A,B,A,A,A), year=as.numeric(c(1970,1970,1970,1976,1980))) and I want to create the

Re: [R] Creating a table

2006-11-14 Thread Benilton Carvalho
tb = table(df$loc, cut(df$year, seq(1970, 1985, by=5), right=F)) rs = rowSums(tb) tb = cbind(tb, rs) cs = colSums(tb) tb = rbind(tb, cs) cheers, b On Nov 14, 2006, at 3:20 PM, Michael Graber wrote: Dear R List, I am a new to R, so my question may be easy to answer for you: I have a

Re: [R] Creating a table

2006-11-14 Thread Peter Alspach
:[EMAIL PROTECTED] On Behalf Of Michael Graber Sent: Wednesday, 15 November 2006 9:21 a.m. To: R-Mailingliste Subject: [R] Creating a table Dear R List, I am a new to R, so my question may be easy to answer for you: I have a dataframe, for example: df-data.frame(loc=c(A,B,A,A,A), year