Displaying 1 result from an estimated 1 matches for "snp005".
Did you mean:
snp001
2009 Mar 30
1
Sum of character vector
Dear list,
I am trying to evaluate how many elements in a vector equal a certain value. The vectors are the columns of a data.frame, read in using read.table():
> dim(data)
[1] 2600 742
> data[1:5,1:5]
SNP001 SNP002 SNP003 SNP004 SNP005
1 GG AA TT TT GG
2 GG AA TC TT GG
3 GG AC CC TT GG
4 AG AA TT TT GG
5 GG AA TC TT GG
> table(data[,1])
AA AG GG
251 1093 1252
but if I do
> sum(data[,1]=="GG")
[1] NA
I...