Saugandh Datta
Saugandh Datta

Reputation: 119

getting this error in R when printing the clusters in terms of the Food labels

food.2.clust <- lapply(1:2, function(nc) check_food_clustering[cut.2==nc])

Show Traceback

Rerun with Debug Error in [.data.frame(check_food_clustering, cut.2 == nc) as

undefined columns selected

Upvotes: 2

Views: 45

Answers (1)

stochazesthai
stochazesthai

Reputation: 697

Try:

food.2.clust <- lapply(1:2, function(nc) check_food_clustering[cut.2==nc, ])

You need a comma after the condition cut.2==nc

Upvotes: 2

Related Questions