reading contigency tables

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

reading contigency tables

Naiara Pinto
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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: reading contigency tables

Wincent
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 <[hidden email]>:

> 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
>
> ______________________________________________
> [hidden email] 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


______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: reading contigency tables

Johannes Huesing
In reply to this post by Naiara Pinto
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 individuals

As 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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: reading contigency tables

Uwe Ligges
In reply to this post by Wincent
ronggui wrote:

> 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 <[hidden email]>:
>
>>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

What is the problem  with read.table()?

Uwe Ligges


>>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
>>
>>______________________________________________
>>[hidden email] 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
>
>
>
> ------------------------------------------------------------------------
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html