Hi! I'm new in R and I'm writing you asking for some guidance. I had analyzed a comparative genomic microarray data of /56 Salmonella/ strains to identify absent genes in each of the serovars, and finally I got a matrix that looks like that:
> data[1:5,1:5] Abortusovis07918 Agona08561 Anatum08125 Arizonae65S Braenderup08488 1 S5305B_IGR S5305B_IGR S5305B_IGR S5305B_IGR S5305B_IGR 2 S5305A_IGR S5300A_IGR S5305A_IGR S5300A_IGR S5300A_IGR 3 S5300A_IGR S5300B_IGR S5300A_IGR S5300B_IGR S5300B_IGR 4 S5300B_IGR S5299B_IGR S5300B_IGR S5299B_IGR S5299B_IGR 5 S5299B_IGR S5299A_IGR S5299B_IGR S5829B_IGR S5299A_IGR The variables corresponds to those genes identified as absent in each of the serovars. I would like to create a presence-absence matrix of those genes comparing all the serovars at the same time, I assume that should not be complicated but I don't know how to do it. I would like a matrix similar to the next one: > data_m[1:5,1:5] Abortusovis07918 Agona08561 Anatum08125 Arizonae65S Braenderup08488 S5305B_IGR 1 1 1 1 1 S5305A_IGR 1 0 1 0 0 S5300A_IGR 1 1 1 1 1 Any help would be welcome, and thank you in advance, Oihane -- Oihane Irazoki Sanchez PhD Student, Molecular Microbiology Genetics and Microbiology Department, Faculty of Biosciences Autonomous University of Barcelona 08193 Bellaterra (Barcelona), Spain Telf: 34 - 935 811 665 E-mail: oihane.iraz...@uab.cat / o.iraz...@gmail.com [[alternative HTML version deleted]] ______________________________________________ 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.