I am currently studying about SVM in R and I have created the model of separation when the data is linear separable but when I have tried this model on data which does not look like linearly separable I am not getting good result I want to know how to use SVM when data is not linear separable.

x<-matrix(rnorm(400),ncol=2)

x[1:100,]=x[1:100,]+2

x[100:150,]=x[100:150,]-2

y<-c(rep(1,150),rep(2,50))

dat1<-data.frame(x,as.factor(y))

plot(x,col=y)

Here we can see that data can not be separated by linear line.