I have a dataset where I am running CAP on different variables. I want to compare age to each of the variables, so I have merged Age and Reprostat into it's own column. But when I run CAP on this new column, it gives me this error:
Error in if (result1$percent > correct) { : missing value where TRUE/FALSE needed
This is the code for merging the columns and the first line of CAP which gives me the error
smetadat$AgeReprostat<-as.factor(paste(smetadat$Age,smetadat$ReproStat,sep=""))
Ordination.model2<-CAPdiscrim (samples~AgeReprostat, data = smetadat,dist="euclid", axes=0,m=0,permutations=0,add=T)
I've checked and there aren't any NA values, this also happens when I merge age and region, however not for age and sex.
Any ideas why I can't run CAP on only some of the merged data columns? Thank you!