Supposing My dataset is iris  with 3 classes and I want to implement one versus one SVM approach but when i subset the training set for each classifier by class i and class j, I get an empty subset (follow this line #selecting subset of training set where Species equal to class i and class j)
Species <-iris$Species
class <- unique(Species)
set.seed(123)
s<- sample (150,100)
data_train<- iris[s,]
data_test<- iris[-s,]
train <-data_train
test <-data_test
for(i in 2:length(unique(Species))-1){
  for(j in (i+1):length(unique(Species))){
    print(paste(class[i],class[j],sep=","))
    #selecting subset of training set and testing set where coronaryEvent equal to class i and class j
    train <-subset(train, Species %in% c(class[i],class[j]))
   str(train)
  }}
[1] "setosa,versicolor"
'data.frame':   0 obs. of  5 variables:
 $ Sepal.Length: num 
 $ Sepal.Width : num 
 $ Petal.Length: num 
 $ Petal.Width : num 
 $ Species     : Factor w/ 3 levels "setosa","versicolor",..: 
[1] "setosa,virginica"
'data.frame':   0 obs. of  5 variables:
 $ Sepal.Length: num 
 $ Sepal.Width : num 
 $ Petal.Length: num 
 $ Petal.Width : num 
 $ Species     : Factor w/ 3 levels "setosa","versicolor",..: 
[1] "versicolor,virginica"
'data.frame':   0 obs. of  5 variables:
 $ Sepal.Length: num 
 $ Sepal.Width : num 
 $ Petal.Length: num 
 $ Petal.Width : num 
 $ Species     : Factor w/ 3 levels "setosa","versicolor",..: 
 
    