Support Vector Machines (Error)

Hi all, I was wondering if someone could guide me on this.

Idealistadata<- attach(IdealistaSVEMresults)
IdealistaSVEMresults$Cluster = factor(IdealistaSVEMresults$Cluster)
training<- createDataPartition(IdealistaSVEMresults$Cluster, p=0.7, list = FALSE)
SVMIdealista <- svm(Cluster ~ ad_price+ ad_activationdate+ad_postalcode+ad_area+ad_builttype+ad_roomnumber+adstats_savedasfavorite+adstats_daysonmarket+layerlocation_population, data = IdealistaSVEMresults[training,])

confusionIdealista<- table(IdealistaSVEMresults[training,"Cluster"],fitted(SVMIdealista),dnn =c("Actual", "Forecasts"))

**And here is where i got the following error: **Error in if (xi > xj) 1L else -1L : valor ausente donde TRUE/FALSE es necesario

And can not get the confusion matrix.

Does anyone knows what Im doing wrong?

IdealistaSVEMresults is a database where I want to classify through Clusters (A-B or C) home prices depending on a set of variables.

Many thanks