Quantcast
Channel: Data Science, Analytics and Big Data discussions - Topics tagged data_science
Viewing all articles
Browse latest Browse all 787

Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' is a list, but does not have components 'x' and 'y' while trying to implement K-means algorithm in R

$
0
0

@adityashrm21 wrote:

Hello,

I was trying to implement K-means algorithm with a dataset.

sub=sample_n(train,100)
kmeansdata=data.frame(sub$temp,sub$humidity)
kmeans=kmeans(kmeansdata,centers=3)
kmeans$centers
sub.temp sub.humidity
1 23.37000 35.07692
2 20.28839 56.80645
3 19.16512 81.53488
plot(kmeans)

and I am getting an error saying

Error in xy.coords(x, y, xlabel, ylabel, log) :
'x' is a list, but does not have components 'x' and 'y'

Why is this error coming and how to remove it?

Thanks.

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 787

Trending Articles