## Not run:
# # Let's generate data with obvious clusters.
# set.seed(1)
# x <- c(x=rnorm(50),rnorm(50)+3);y = c(rnorm(50),rnorm(50)+3)
# A <- cbind(x,y)
# # Plot the data (try to set the aspect ratio square)
# # Let a be an m x n matrix.
# # Each row of the matrix A is a point in an n-dimensional Euclidean space.
# library("scidb")
# scidbconnect()
# A = as.scidb(A)
# k = kmeans(A, 2, 10)
# plot(A[], asp=1,xlab="x",ylab="y")
# points(A[k$cluster %==%0, ][], pch=19,col=4)
# ## End(Not run)
Run the code above in your browser using DataLab