I am currently doing a problem of SVM in R and while doing a problem I came across that by changing the value of cost the plot function changes and giving different type of classification .I want to know what should be the value of cost and how to decide it.

set.seed(1)

x<-matrix(rnorm(20*2),ncol=2)

y<-c(rep(-1,10),rep(1,10))

x[y==1,]=x[y==1,]+1

plot(x,col=(3-y))

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

require(e1071)

svmfit=svm(y~.,data=dat,kernel=“linear”,cost=10,scale=FALSE)

plot(svmfit,dat)

svm.fit=svm(y~.,data=dat,kernel=“linear”,cost=0.1,scale=FALSE)

plot(svm.fit,dat)

we can see we are getting different result