## Define a sequence object
data(biofam)
bf.seq <- seqdef(biofam,10:25)
couts <- seqsubm(bf.seq, method="TRATE")
## compute distance
biofam.om <- seqdist(bf.seq,method="OM",indel=2,sm=couts)
#compute distance to center according to gender
distcenter <- seqdcenter(biofam.om, biofam$sex)
## ploting distribution of dist to center as a silhouette plot
## Ploting two plots
par(mfrow=c(1,2))
barplot(sort(distcenter[biofam$sex=="man"]), main="Man",border=NA,space=0,col="cyan")
barplot(sort(distcenter[biofam$sex=="woman"]), main="Woman",border=NA,space=0,col="cyan")Run the code above in your browser using DataLab