pca ggplot with hierarchical clustering on shiny

175 Views Asked by At

Il try to create a shiny app that print a pca ggplot with hierarchical clustering and the following error appears: Warning: Error in : You're passing a function as global data. Have you misspelled the data argument in ggplot(). what could be the problem? Here's the server:


    
    palette(c("#E41A1C", "#377EB8", "#4DAF4A", "#984EA3",
             "#FF7F00", "#FFFF33", "#A65628", "#F781BF", "#999999"))
    
    ggplot(swissDf, aes(x=PC1, y=PC2)) +
      theme_classic() +
      geom_hline(yintercept = 0, color = "gray70") +
      geom_vline(xintercept = 0, color = "gray70") +
      geom_point(aes(color = cluster), alpha = 0.55, size = 3) +
      xlab("PC1") +
      ylab("PC2") + 
      
      ggtitle("PCA Clusters from Hierarchical Clustering of Cars Data")
    
    })
  
}



shinyApp(ui, server)

0

There are 0 best solutions below