I've just reproduced your example and obtained no error but only a warning. Bellow, there are the results from my PC (Windows) with the latest R version (3.2.2) and latest compareGroups version (3.0.1)
Please, could you indicate me the R and compareGroups package versions you are using?
Isaac.
> library(compareGroups)
> compareGroups(AF~age,method=2,data=temp,Q1=0,Q3=1)
-------- Summary of results by groups of 'AF'---------
var N p.value method selection
1 age 701 0.004** continuous non-normal ALL
-----
Signif. codes: 0 '**' 0.05 '*' 0.1 ' ' 1
Warning message:
In cor.test.default(x, as.integer(y), method = "spearman") :
Cannot compute exact p-value with ties