Try this:

Lines <- "A,B,C,D,G
A,C,E,O
F,G"

x <- read.table(textConnection(Lines), sep = ",", fill = TRUE, colClasses =
rep('character', 3))
xtabs( ~ r + values, transform(stack(x), r = rownames(x)))


On Thu, Jun 17, 2010 at 7:10 AM, <ricardosousa2000@clix.pt> wrote:

>
>   Hello,
>       I'm new in using the R, but from what I read is an excellent tool.
>      Would you like if I could help, I am trying create an array from
> reading
>   a text file.
>      The idea is to read the file, and transform the data in binary format,
>   for example. The calves of this file format.
>   A,B,C,D,G
>   A,C,E,O
>   F,G
>   Put this away
>      a b c d e f g o
>   1  1 1 1 1 0 0 1 0
>   2  1 0 1 0 1 0 0 1
>   3  0 0 0 0 0 1 0 0
>    and display in monitor.
>     Thanks for the help
>     _________________________________________________________________
>
>   Уrea de Clientes Optimus Clix т Toda a gestУЃo dos seus serviУЇos online!
>   http://cliente.clix.pt/.
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Henrique Dallazuanna
Curitiba-Paranс-Brasil
25А 25' 40" S 49А 16' 22" O

	[[alternative HTML version deleted]]

