I am trying to cut out the list of gene names that I was given. I am trying to eliminate any duplicate names that may be present, but I keep getting an error when running my code:
counter=0
i=0
j=0
geneNamesRevised=array(dim=length(geneNames))
for (i in 0:length(geneNamesRevised))
geneNamesRevised[i]=""
geneNamesRevised
for (i in 1:length(geneNames))
for (j in 1:length(geneNamesRevised))
if (geneNames[i]==geneNamesRevised[j])
{
break
}
else if ((j==length(geneNamesRevised)-1) &&
(geneNames[i]!=geneNamesRevised[j]))
{
geneNamesRevised[counter]=geneNames[i]
counter++
}
The error message is a repeating line:
the condition has a length> 1, and only the first element will be used, the condition has a length> 1, and only the first element will be used, the condition has a length> 1, and only the first element will be used
and this is an error message for the last "else if" statement having "& &".
Thank!
source
share