r - Error in ggplot2: Use show_guide = TRUE or show_guide = FALSE to display or suppress the guide display. (Defunct; last used in version 0.8.9) -


i'm getting following error while using ggplot2:

df=iris m=as.matrix(cbind(df$petal.length, df$petal.width),ncol=2) cl=(kmeans(m,3)) df$cluster=factor(cl$cluster) centers=as.data.frame(cl$centers) library(ggplot2) ggplot(data=df, aes(x=petal.length, y=petal.width, color=cluster )) +       geom_point() +       geom_point(data=centers, aes(x=v1,y=v2, color='center')) +      geom_point(data=centers, aes(x=v1,y=v2, color='center'), size=52, alpha=.3, legend=false)  error: use show_guide = true or show_guide = false display or suppress guide display. (defunct; last used in version 0.8.9) 

my version.string version.string r version 3.1.2 (2014-10-31)

instead of metioning legend false in geom_point(data=centers, aes(x=v1,y=v2, color='center'), size=52, alpha=.3, legend=false). using guides() function

try following

ggplot(data=df, aes(x=petal.length, y=petal.width, color=cluster )) +    geom_point() +    geom_point(data=centers, aes(x=v1,y=v2, color='center')) +   geom_point(data=centers, aes(x=v1,y=v2, color='center'), size=52, alpha=.3) +   guides(color = false) 

Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -