I have been merrily using the genetics package and more specifically have
been using the makeGenotypes and genotypes function. I check my
accomplishments by going

> class(g2)
[1] "genotype" "factor"

and likewise

> class(g1)
[1] "genotype" "factor"

Yet when I execute a command such as allele count I get this
> allele.count(g1)
       D  I
 [1,]  2  0
 [2,]  1  1
 [3,]  2  0
 [4,]  0  2
 [5,]  2  0
 [6,]  2  0
 [7,]  2  0
 [8,]  2  0
 [9,]  0  2
[10,] NA NA

> allele.count(g2)
list()
If I print the objects I get this
> g1
 [1] "D/D" "D/I" "D/D" "I/I" "D/D" "D/D" "D/D" "D/D" "I/I" NA
Alleles: D I
> g2
 [1] "1/1" "1/1" "1/1" "1/1" "1/1" "1/1" "1/1" "1/1" "2/2" "1/1" "2/2" "1/1"
"1/1" "1/1"
Alleles:

Clearly g1 and g2 are not exactly the same even though they are the same
class.
I can make g2 behave as g1 if i type
g3<-genotype(g2)
g3 then behaves as it should.

The issue may have arrisen since g2 is just a subset of a much bigger object
that was created using reshape command in the base package or maybe melt and
cast in the reshape package. Can anyone enlighten me?
-- 
Farrel Buchinsky
Mobile: (412) 779-1073

        [[alternative HTML version deleted]]

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

Reply via email to