Hi all, I need some help using read.ftable to read a contingency table. My columns are organized as follows: order--family--species--location--number of individuals I couldn't figure out how to change the data on my text file to be imported into R; and after you do that, is it possible to convert the table into a data frame? Any tips would be greatly appreciatted! Thanks a lot, Naiara. -------------------------------------------- Naiara S. Pinto Ecology, Evolution and Behavior 1 University Station A6700 Austin, TX, 78712
I think it can.But if you provide more information,you will be more help. for example,you had better give a reproducable example in you email. 2006/1/11, Naiara S. Pinto <naiara at mail.utexas.edu>:> Hi all, > > I need some help using read.ftable to read a contingency table. My columns > are organized as follows: > order--family--species--location--number of individuals > > I couldn't figure out how to change the data on my text file to be > imported into R; and after you do that, is it possible to convert the > table into a data frame? Any tips would be greatly appreciatted! > > Thanks a lot, > > Naiara. > > -------------------------------------------- > Naiara S. Pinto > Ecology, Evolution and Behavior > 1 University Station A6700 > Austin, TX, 78712 > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >-- 伝伷伻佡伖侒 Deparment of Sociology Fudan University
Just a remark:> I need some help using read.ftable to read a contingency table. My columns > are organized as follows: > order--family--species--location--number of individualsAs the first three variables are nested, I would expect this table to contain a lot of structural zeroes. I understand you just get the data in table form and do not intend to work on them as a contingency table.> I couldn't figure out how to change the data on my text file to be > imported into R; and after you do that, is it possible to convert the > table into a data frame? Any tips would be greatly appreciatted!data(HairEyeColor) condensed <- as.data.frame(HairEyeColor) If this is not sufficient, then extended <- condensed[-ncol(condensed), rep(1:nrow(condensed), condensed[,ncol(condensed)])] should do the trick. Greetings Johannes