0

Code:

plot.data <- bind_cols(data.norm, Cluster = 
as.factor(result$cluster))
plot.centres <- as.data.frame(result$centers)
plot.centres$Cluster <- rownames(result$centers)
ggplot(plot.data) + aes(x = RI, y = Si, color = Cluster) + 
geom_point() +
geom_point(data = plot.centres, shape=8, size =4)

It gives the error:

 Error in FUN(X[[i]], ...) : object 'RI' not found

I have installed the RI package but it still does not help.

  • 2
    Your code says RI is a column of your data. Is it? – LuizZ Nov 30 '20 at 18:23
  • Yes, it is a column. – Learningtocodegirl Nov 30 '20 at 18:35
  • Try: `ggplot(plot.data, aes(x = RI, y = Si, color = Cluster))+ ` instead of `ggplot(plot.data) + aes(x = RI, y = Si, color = Cluster) + ` That is, put the `aes ` specification inside the ggplot function. – LuizZ Nov 30 '20 at 19:05
  • I changed the code but it gives the error message: Error: Cannot add ggproto objects together. Did you forget to add this object to a ggplot object? Run `rlang::last_error()` to see where the error occurred. – Learningtocodegirl Nov 30 '20 at 19:19
  • Please provide a minimum reproducible example, check this to learn how to do so: https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – LuizZ Nov 30 '20 at 19:21

0 Answers0