R 只有两个变量的聚类?

R 只有两个变量的聚类?,r,scatter-plot,R,Scatter Plot,我想对我的二维数据集进行聚类,但我想不通。我的数据集如下所示 dt<-data.frame(x=c(rnorm(10, 2,1), rnorm(10, 6,1)), categorize=c(rep(1,10), rep(2,10))) dtggplot(dt,aes(x,y=1,color=factor(categorize)))+geom_point()?与(dt,plot(x,col=categorize+1,pch=20))使用基本图形?

我想对我的二维数据集进行聚类,但我想不通。我的数据集如下所示

dt<-data.frame(x=c(rnorm(10, 2,1), rnorm(10, 6,1)), categorize=c(rep(1,10), rep(2,10)))
dt
ggplot(dt,aes(x,y=1,color=factor(categorize)))+geom_point()
与(dt,plot(x,col=categorize+1,pch=20))
使用基本图形?